finding NON in matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all In the matrix A which is 1*N matrix, I want to recognize if there is any element equal to NON in it,I replace it by zero.How can I do that?
2 Kommentare
Akzeptierte Antwort
Laura Proctor
am 24 Mai 2011
I'm going to assume that you mean NaN. You can use the ISNAN function to find and replace the NaNs in your code. Here's an example:
A = randn(1,100);
A([2,10,23,47,88]) = NaN;
A(isnan(A)) = 0;
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Logical 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!