Wanted to check if a variable exits or not within 'nirsinfo'.
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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.
Risposte (1)
Sahithi Kanumarlapudi
il 4 Nov 2019
‘isfield' can be used to check if a field exists within a structure.
Refer to the following documentation for more information on ‘isfield’
0 Commenti
Vedere anche
Categorie
Scopri di più su Structures in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!