MATLABの構造体内のフィールドの存在を確認する関数はありますか?
Mostrar comentarios más antiguos
'構造体'という特定の名前を持つ構造体が存在するかどうかを確認するには、'exist' 関数を使用します。また、構造体配列内にフィールドが存在するかどうかを確認するには、'isfield' 関数を使用します。しかし、私は構造体の中のどこかにフィールドが存在するかどうかを確認する関数が欲しいです。例えば、以下のコードでは、'isfield' 関数は "c" が "a" のフィールドであることを認識しません。
a.b.c = 1;
isfield(a, 'c')
この結果は以下の通りです:
ans =
0
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 構造体 en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!