MATLAB: How to check if cell has particular value or not

cellforifisemptyisequalnan

Hi,
I have variable named 'result1' which is basically 1*2 cell and i want to write condition saying.
Thanks in Advance
if result1="NaN" % either in index1 or index2
% do this cal

else
% do this cal
end

Best Answer

contains() - if it contains "NaN" a string
isnan() - if it contains NaN value