MATLAB: Counting the non nan observations in a matrix by row

isnannansum

Hi,
I have a matrix for which I want to compute the number of non-nan observations for each row without running a loop. is this possible?

Best Answer

sum(~isnan(A),2)