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?

 Akzeptierte Antwort

Mischa Kim
Mischa Kim am 17 Mär. 2014
Bearbeitet: Mischa Kim am 17 Mär. 2014

0 Stimmen

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 Kommentare

Ashley
Ashley am 17 Mär. 2014
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 am 17 Mär. 2014
Bearbeitet: Mischa Kim am 17 Mär. 2014
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 am 17 Mär. 2014
Yes! Thank you so much

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Gefragt:

am 17 Mär. 2014

Kommentiert:

am 17 Mär. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by