How do I use the "omitnan' option for the Mean function when calling the function using the splitapply function?

77 vues (au cours des 30 derniers jours)
I would like to use the following command: splitapply(@mean,MyArray,G) but call the @mean function using the "omitnan" option. How can I do that? In this example, MyArray is the array that I would like to apply the mean function to after I have split it into Groups dictated by the G vector

Réponse acceptée

Star Strider
Star Strider le 24 Fév 2020
One option:
splitapply(@(x)mean(x,'omitnan'),MyArray,G)
  6 commentaires
Star Strider
Star Strider le 13 Déc 2020
Phoebe Armitage —
My pleasure!
(A Vote would be appreciated!)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Just for fun dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by