MATLAB: How to make a contour plot of a matrix consisting of 1 and NaN from a 3D array

3d arraycontourfnan

Hello,
I have a 3D image. I would like using contourf function to visualize this image, but there is NaN. This NaN are useful because I have also true 0 in my 3D array.
figure,contourf(squeeze(mean(imgd3,1)));
When I used it, an error message displayed:
Warning: Contour not rendered for non-finite ZData
> In contourf (line 60)
I read that contourf can not manage with NaN value. But, I can transform them in 0. Do you have any idea to plot this image ?
Thanks

Best Answer

contourf(squeeze(mean(imgd3,'omitnan')))
Related Question