How to ignore NaN values in pcolor function?

7 次查看(过去 30 天)
I have three data lati, long, CaCO3. The size of each data is 180x1, 180x1, 180x180. lati and long don't have NaN values but CaCO3 have.
A part of CaCO3 matrix is
CaCO3 =
86.4195 88.6516 87.6645 NaN NaN
90.9402 89.1650 89.9154 NaN NaN
87.4232 94.4415 87.3036 91.3506 90.5179
NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN
NaN 91.5944 NaN NaN NaN
NaN 88.8381 87.1006 NaN NaN ......
NaN 89.5835 NaN NaN NaN
NaN 89.5548 NaN NaN NaN
87.2730 95.8932 87.5370 91.7358 91.7450
87.9113 96.3841 88.3516 89.7063 90.6103
89.8246 92.2127 90.4637 91.2455 92.1979
90.9599 93.2109 90.6547 97.5123 97.5610
When I used pcolor(long,lati.CaCO3), the result was a picture below. I think black lines represent because of NaN values, so how to ignore NaN values?

采纳的回答

Daniel kiracofe
Daniel kiracofe 2016-11-6
I don't think the black lines are because of the NaNs. Its coming from the default shading method, which is faceted. Try "shading flat" or "shading interp".
https://www.mathworks.com/help/matlab/ref/shading.html

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 NaNs 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by