how to delete field in struct in loop?
2 次查看(过去 30 天)
显示 更早的评论
In have struct A having fields A1(2x1), A2(2x1), A3(12x1) ....A100(23x1). I want to delete fields whose size is (2x1). how to delete it
0 个评论
采纳的回答
Andrei Bobrov
2014-9-11
n1 = fieldnames(A);
Aout = rmfield(A,n1(cellfun(@numel,struct2cell(A)) == 2));
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!