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

 Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 11 Mai 2016
Bearbeitet: Andrei Bobrov am 11 Mai 2016

2 Stimmen

out = {t(~cellfun(@isempty,{t.places})).places};
t = cell2struct(out,{'places'},1);
or jast
t = t(~cellfun(@isempty,{t.places}));

Weitere Antworten (0)

Kategorien

Community Treasure Hunt

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

Start Hunting!

Translated by