how delete empty fields in a struct
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
elisa ewin
am 11 Mai 2016
Kommentiert: Lynn McCane
am 26 Jun. 2023
Hi! I have a struct (attached) and I want to delete the empty field, how can I do?
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 11 Mai 2016
Bearbeitet: Andrei Bobrov
am 11 Mai 2016
out = {t(~cellfun(@isempty,{t.places})).places};
t = cell2struct(out,{'places'},1);
or jast
t = t(~cellfun(@isempty,{t.places}));
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!