How to display structs only in a struct with fields?
Afficher commentaires plus anciens
I'm trying to display only the 1x1 struct portions and hide the character portions in a struct with fields.
aTable=struct2table(S);
disp(aTable);
Réponse acceptée
Plus de réponses (1)
t='11'; s.q=1;
S=struct('a',t,'b',s,'c',s,'d',[s,s])
p=reshape( namedargs2cell(S) , 2,[]);
keep=structfun(@(f)isstruct(f) & isscalar(f), S);
s=struct(p{:,keep});
disp(s)
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!