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 ExchangeMatrix Decomposition についてさらに検索

質問済み:

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