MATLAB: How to find row/column indices having all values NaN

arraymatrixmatrix arraymatrix manipulationstatistics

I have a Matrix, where few rows/columns have NaN value corresponding to all the columns/rows respectively. I know how to remove these rows/columns: X=X(:,~all(is an(X))); But I want to know the indices of these rows/columns.
Can anyone please help me?

Best Answer

If x is your matrix, do you mean
find(all(isnan(x),2))
or
find(all(isnan(x),1))
HTH
Related Question