If we define A to be a 3x3 matrix with scalar values, is this correct?
zscore(A) = (x̄ - μ)row 1 + (x̄ - μ)row 2 + (x̄ - μ)row 3
or is there a different function to calculate this in Matlab without doing it all step by step in a gigantic matrix?

 채택된 답변

Mischa Kim
Mischa Kim 2014년 3월 17일
편집: Mischa Kim 2014년 3월 17일

0 개 추천

Ashley, zscore(A) can also be computed as
n = size(A,1);
zScoreA = (A - ones(n,1)*mean(A))./(ones(n,1)*std(A));

댓글 수: 3

Ashley
Ashley 2014년 3월 17일
I apologize, I meant to ask:
For a 3x3 matrix in Matlab, how would I find this?
= (x̄ - μ)row 1 + (x̄ - μ)row 2 + (x̄ - μ)row 3
Mischa Kim
Mischa Kim 2014년 3월 17일
편집: Mischa Kim 2014년 3월 17일
This also works for a 3-by-3, of course:
A = rand(3,3);
n = size(A,1);
zScoreA = (A - ones(n,1)*mean(A))./(ones(n,1)*std(A))
With MATLAB you don't need to do it row by row or column by column. You can do it for the entire matrix at once. Is this what you mean?
Ashley
Ashley 2014년 3월 17일
Yes! Thank you so much

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2014년 3월 17일

댓글:

2014년 3월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by