Azzera filtri
Azzera filtri

how delete empty fields in a struct

5 visualizzazioni (ultimi 30 giorni)
elisa ewin
elisa ewin il 11 Mag 2016
Commentato: Lynn McCane il 26 Giu 2023
Hi! I have a struct (attached) and I want to delete the empty field, how can I do?

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 11 Mag 2016
Modificato: Andrei Bobrov il 11 Mag 2016
out = {t(~cellfun(@isempty,{t.places})).places};
t = cell2struct(out,{'places'},1);
or jast
t = t(~cellfun(@isempty,{t.places}));

Più risposte (0)

Categorie

Scopri di più su Structures in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by