How get a mean value without nan values?
Ältere Kommentare anzeigen
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 Kommentare
Dyuman Joshi
am 26 Apr. 2023
Bearbeitet: Image Analyst
am 26 Apr. 2023
%Example
SWM = [1.77 -0.005 NaN -2.95; ...
NaN 0.34 NaN 0.19];
nanmean(SWM)
mean(SWM,'omitnan') % built-in alternative
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
am 26 Apr. 2023
If you have R2023a, another option is to use:
SWM_Mmean = fillmissing2(mean(SWM,3), 'linear');
.
Sakuni Samarakoon
am 27 Apr. 2023
Antworten (0)
Kategorien
Mehr zu Color and Styling finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!