【類似の質問】
- how delete empty fields in a struct
- How to remove empty struct fields [ ] from a group a struct fields ?
A = struct('a',"abc",'b',"def",'c',[])
fn = fieldnames(A);
B = rmfield(A, fn(cellfun(@(c) isempty(A.(c)), fn)))
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!