Wanted to check if a variable exits or not within 'nirsinfo'.
1 回表示 (過去 30 日間)
古いコメントを表示
if exist(nirsInfo.RawDataInfo.checking,'var') == 1
disp("file exists");
else
disp("doesnt");
end
Here since the .checking doesn't exsist it throwing Reference to non-existent field 'checking' error.
回答 (1 件)
Sahithi Kanumarlapudi
2019 年 11 月 4 日
‘isfield' can be used to check if a field exists within a structure.
Refer to the following documentation for more information on ‘isfield’
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!