delete a NAN but leave a zero instead to be later taken out
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Adrienne
am 20 Mai 2014
Bearbeitet: George Papazafeiropoulos
am 20 Mai 2014
Ok so as the question says I want to delete the NAN without deleting the row as it messes up my data, instead I want a zero to be left in its place so I can take it out later (which is successful).
NaN 0
1 3
1 3
1 3
2 4
2 4
2 4
3 1
3 1
3 1
4 2
4 2
4 2
NaN 0
5 4
0 Kommentare
Akzeptierte Antwort
George Papazafeiropoulos
am 20 Mai 2014
Bearbeitet: George Papazafeiropoulos
am 20 Mai 2014
A=[NaN 0; 1 3; 1 3; 1 3; 2 4; 2 4; 2 4; 3 1; 3 1; 3 1; 4 2; 4 2; 4 2; NaN 0; 5 4];
sizA=size(A,1);
A=A(:);
A(isnan(A))=0;
A=reshape(A,sizA,[])
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings 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!