Hi, I have doubt in mean. if we have more than 10000 rows why mean doesn't work actually sum also does not work. for example, All_measured = 43472*30 double and the mean formula: mean(All_measured ,2) but the answer is 43472*1 full of NaN Any suitable ideas are very appreciable.

 Réponse acceptée

Star Strider
Star Strider le 6 Juil 2017

1 vote

Try this:
mean(All_measured ,2, 'omitnan')
or:
nanmean(All_measured ,2)

4 commentaires

Venkat Ta
Venkat Ta le 6 Juil 2017
Modifié(e) : Stephen23 le 6 Juil 2017
Hi,
Thanks a lot for the function. And if I will use same format for standard deviation (S = std(All_measured,0,2,'omitnan')), it would be correct?
Best, Venkat
Star Strider
Star Strider le 6 Juil 2017
My pleasure.
Yes.
I would change your assignment slightly, to:
S = std(All_measured,[],2,'omitnan')
The ‘[]’ indicates that an argument (here,the weight vector) is not supplied, instructing the function to use its default values, rather than giving it a numeric value.
Venkat Ta
Venkat Ta le 7 Juil 2017
Perfect. Thanks a lot.
Star Strider
Star Strider le 7 Juil 2017
As always, my pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by