how can I use mean for cell arrays within cell

4 vues (au cours des 30 derniers jours)
Farshid Daryabor
Farshid Daryabor le 25 Fév 2020
Commenté : Farshid Daryabor le 26 Fév 2020
Dear users,
I want to calculate the annual average of the attached file from the data in the cell array, regardless of the NaNs values.
Thanks in advance,

Réponses (1)

Bhaskar R
Bhaskar R le 25 Fév 2020
result = cellfun(@(x)mean(x, 'omitnan'), [T_mon{:}])
  2 commentaires
Farshid Daryabor
Farshid Daryabor le 25 Fév 2020
Bhaskar, thanks for your comment, but I want to keep the order of the temperature values ​​with respect to the depth decrease as in the original. Could you please leave me your idea. Thanks
Farshid Daryabor
Farshid Daryabor le 26 Fév 2020
The following comment is what I expected to be.
result = cellfun(@(x) nanmean(x,2), T_mon,'UniformOutput',false);
Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur Verification, Validation, and Test dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by