delete a NAN but leave a zero instead to be later taken out
1 回表示 (過去 30 日間)
古いコメントを表示
Adrienne
2014 年 5 月 20 日
編集済み: George Papazafeiropoulos
2014 年 5 月 20 日
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 件のコメント
採用された回答
George Papazafeiropoulos
2014 年 5 月 20 日
編集済み: George Papazafeiropoulos
2014 年 5 月 20 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!