A = NaN 100 101 102 103 104 201 2 7 3 2 2 202 NaN 8 4 5 6 203 NaN NaN 2 3 5 205 3 4 2 6 4
I have a matrix with the first row and first column being headers. I would like to know the no. occurences and subscripts on NaN.
To find no. of occurences, I did
number_of_nan = sum(sum(isnan(A(2:end,2:end))))
Also,
logical_array = isnan(A(2:end,2:end)); numel(logical_array(logical_array == 1));
Is there a simpler/better way. Also how do I find the subscripts of the NaN elements in the array ?
Best Answer