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 :)

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2019년 1월 28일

1 개 추천

Maybe those values are not strictly zero. Try this example
a=zeros(2,2,2)
a(a==0)=nan

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 NaNs에 대해 자세히 알아보기

태그

질문:

2019년 1월 28일

답변:

2019년 1월 28일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by