フィルターのクリア

how to delete field in struct in loop?

2 ビュー (過去 30 日間)
Sagar Dhage
Sagar Dhage 2014 年 9 月 11 日
回答済み: Andrei Bobrov 2014 年 9 月 11 日
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

採用された回答

Andrei Bobrov
Andrei Bobrov 2014 年 9 月 11 日
n1 = fieldnames(A);
Aout = rmfield(A,n1(cellfun(@numel,struct2cell(A)) == 2));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by