필터 지우기
필터 지우기

mean and standard deviation code

조회 수: 1 (최근 30일)
joo
joo 2012년 11월 28일
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
Daniel Shub
Daniel Shub 2012년 11월 28일
I am closing as a DOIT4ME

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2012년 11월 28일
Look at the second input argument of mean().
  댓글 수: 2
joo
joo 2012년 11월 28일
thanjk kyou so mcuh
joo
joo 2012년 11월 28일

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Mitch Martelli
Mitch Martelli 2012년 11월 28일
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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by