How do I replace 0 with NaN in an 3D array?
9 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I'm novice with matlab and I am looking for analyze a 3D object. However, the zero in my 3D array represent nothing in reality. So I would like replace them by NaN on each z before to perform more analysis of my object.
When I use:
img(img==0) = NaN
it does not work.
Have you another idea ?
Thanks :)
0 件のコメント
採用された回答
Fangjun Jiang
2019 年 1 月 28 日
Maybe those values are not strictly zero. Try this example
a=zeros(2,2,2)
a(a==0)=nan
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!