MATLABの構造体内のフィールドの存在を確認する関数はありますか?
Afficher commentaires plus anciens
'構造体'という特定の名前を持つ構造体が存在するかどうかを確認するには、'exist' 関数を使用します。また、構造体配列内にフィールドが存在するかどうかを確認するには、'isfield' 関数を使用します。しかし、私は構造体の中のどこかにフィールドが存在するかどうかを確認する関数が欲しいです。例えば、以下のコードでは、'isfield' 関数は "c" が "a" のフィールドであることを認識しません。
a.b.c = 1;
isfield(a, 'c')
この結果は以下の通りです:
ans =
0
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 構造体 dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!