I have 1345*649*90 double type chlorophyll-a dataset. I got mean value using the nanmean. But after plotting the data, the some white patches are on the colormap. I want to solve this issue. This is the code which I used get the mean.
SWM_mean=squeeze(nanmean(SWM,3));

댓글 수: 3

Although, nanmean is not recommended, it is expected to give the correct results -
%Example
SWM = [1.77 -0.005 NaN -2.95; ...
NaN 0.34 NaN 0.19];
nanmean(SWM)
ans = 1×4
1.7700 0.1675 NaN -1.3800
mean(SWM,'omitnan') % built-in alternative
ans = 1×4
1.7700 0.1675 NaN -1.3800
The issue might be something else. It might be the case that all the data along that particular dimension is NaN.
In any case, more information is required to give a suggestion/solution. Please attach your code and data (use the paperclip button to do so).
Star Strider
Star Strider 2023년 4월 26일
If you have R2023a, another option is to use:
SWM_Mmean = fillmissing2(mean(SWM,3), 'linear');
The fillmissing2 function was introduced in R2023a.
.
I have Matlab version R2020a. Thank you for your response and this will be important my future works.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

질문:

2023년 4월 26일

댓글:

2023년 4월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by