MATLABの構造体内のフィールドの存在を確認する関数はありますか?
Ältere Kommentare anzeigen
'構造体'という特定の名前を持つ構造体が存在するかどうかを確認するには、'exist' 関数を使用します。また、構造体配列内にフィールドが存在するかどうかを確認するには、'isfield' 関数を使用します。しかし、私は構造体の中のどこかにフィールドが存在するかどうかを確認する関数が欲しいです。例えば、以下のコードでは、'isfield' 関数は "c" が "a" のフィールドであることを認識しません。
a.b.c = 1;
isfield(a, 'c')
この結果は以下の通りです:
ans =
0
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu 構造体 finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!