how delete empty fields in a struct

3 views (last 30 days)
Hi! I have a struct (attached) and I want to delete the empty field, how can I do?

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 11 May 2016
Edited: Andrei Bobrov on 11 May 2016
out = {t(~cellfun(@isempty,{t.places})).places};
t = cell2struct(out,{'places'},1);
or jast
t = t(~cellfun(@isempty,{t.places}));

More Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!