find nan and eliminate it in matrix
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
Walter Roberson
il 18 Nov 2012
0 voti
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?
Categorie
Scopri di più su NaNs in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!