Wanted to check if a variable exits or not within 'nirsinfo'.
조회 수: 2 (최근 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!