Filter löschen
Filter löschen

how delete empty fields in a struct

5 Ansichten (letzte 30 Tage)
elisa ewin
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?

Akzeptierte Antwort

Andrei Bobrov
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}));

Weitere Antworten (0)

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!

Translated by