Find NaN elements in a matrix
Mostrar comentarios más antiguos
Hi Guys,
How can I find the exact location of NaN elements in a matrix. I work with really large arrays (size 1500*200).
How can I find which row has a NaN value in a column matrix or vice versa.?
Thanks
N
Respuesta aceptada
Más respuestas (3)
Wayne King
el 12 de Oct. de 2011
One way:
X = ones(10,4);
X(3,4) = NaN;
indices = find(isnan(X) == 1);
[I,J] = ind2sub(size(X),indices);
Elizabeth Drybrugh
el 3 de Mayo de 2018
Editada: Elizabeth Drybrugh
el 3 de Mayo de 2018
Do this to get the sum
sum(isnan(x))
For other functions, it depends on what you actually need....
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!