how delete empty fields in a struct

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

Community Treasure Hunt

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

Start Hunting!