how delete empty fields in a struct
3 views (last 30 days)
Show older comments
Hi! I have a struct (attached) and I want to delete the empty field, how can I do?
0 Comments
Accepted Answer
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)
See Also
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!