How to find row/column indices having all values NaN?

41 Ansichten (letzte 30 Tage)
Subir Paul
Subir Paul am 25 Mai 2017
Kommentiert: Subir Paul am 26 Mai 2017
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?

Akzeptierte Antwort

Honglei Chen
Honglei Chen am 25 Mai 2017
If x is your matrix, do you mean
find(all(isnan(x),2))
or
find(all(isnan(x),1))
HTH

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by