MATLAB: How to find NaN values in a cell array.

??? undefined function or method 'isnan' for input arguments of type 'cell'.

This is my data:
a = {'raja' 'I' 76 56 NaN;'bala' 'R' 12 7 56;'kavi' NaN 56 5 12}
X = find(isnan(a));
I got
??? undefined function or method 'isnan'
for input arguments of type 'cell'.

Best Answer

Try this to examine columns 2 onwards:
a = {'raja' 'I' 76 56 NaN;'bala' 'R' 12 7 56;'kavi' NaN 56 5 12}
b = cell2mat(cellfun(@isnan, a(:, 2:end), 'UniformOutput', false))
You'll see:
a =
3×5 cell array
'raja' 'I' [76] [56] [NaN]
'bala' 'R' [12] [ 7] [ 56]
'kavi' [NaN] [56] [ 5] [ 12]
b =
3×4 logical array
0 0 0 1
0 0 0 0
1 0 0 0