How to display structs only in a struct with fields?
이전 댓글 표시
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);
채택된 답변
추가 답변 (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)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!