find nan and eliminate it in matrix
Mostrar comentarios más antiguos
hi!
i wann explain may problem with an example:
% A=[1 2 3;5 4 6;nan nan nan]
to eleminate nan: A=(A(~isnan(A)));
i get this array:A=[1 2 3 5 4 6];
why not A=[1 2 3; 5 4 6]?
i know we could use reshape. is there any other method?
thanx
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 18 de Nov. de 2012
0 votos
What do you want to have happen if the rows contain unequal number of nans? Do you want to delete the entire row if any member of the row contains a nan? Or only delete the row if it is all nan?
Categorías
Más información sobre NaNs 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!