Effacer les filtres
Effacer les filtres

mean and standard deviation code

1 vue (au cours des 30 derniers jours)
joo
joo le 28 Nov 2012
i have
3 2 4
2 3 7
4 2 3
i want the mean
3 (3+2+4 /3)
4 (2+3+7 /3)
3 (4+2+3 /3)
and i want the standard deviation
1
0,577350269
2,081665999
can someone give me the code to do this? thank yo
  1 commentaire
Daniel Shub
Daniel Shub le 28 Nov 2012
I am closing as a DOIT4ME

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 28 Nov 2012
Look at the second input argument of mean().
  2 commentaires
joo
joo le 28 Nov 2012
thanjk kyou so mcuh
joo
joo le 28 Nov 2012

Connectez-vous pour commenter.

Plus de réponses (1)

Mitch Martelli
Mitch Martelli le 28 Nov 2012
Hi,
From your post i suppose that you would like the mean rows by rows, and you want the standard deviation columns by columns.
In litirature there is two different way to define the standard devaition.
So you can set the variable type to 0 if you want to normalize by (n-1) or you can set 1 if you would like to normalize by n.
See Matlab help or wikipedia for more information.
Example code :
data=[3 2 4
2 3 7
4 2 3 ];
mean_data=mean(data,2);
type=0;
std_data=std(data,type,1);
Best regards
M1tC4

Catégories

En savoir plus sur Logical 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