フィルターのクリア

How to know if exist an field into a struct?

4 ビュー (過去 30 日間)
jon
jon 2016 年 4 月 14 日
コメント済み: jon 2016 年 4 月 14 日
I want a funtion which give me "0" if dosen't exist a field into a struct and "1" if it exist, something like that:
s=struct("field1",val1,"field2",val2,"field3",val3);
exist(s.field1)
=1
exist(s.field5)
=0

採用された回答

Steven Lord
Steven Lord 2016 年 4 月 14 日
Take a look at isfield.
  1 件のコメント
jon
jon 2016 年 4 月 14 日
It works perfect Thanks

サインインしてコメントする。

その他の回答 (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