How to display structs only in a struct with fields?
Mostrar comentarios más antiguos
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);
Respuesta aceptada
Más respuestas (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)
Categorías
Más información sobre Structures en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!