展开全部
用zscore,标准化的目的是:使得平均值为0,标准差为1,这样可以使不同量纲的数据放在一个矩阵.
>> A=magic(4)
A =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> [Z,MU,SIGMA] = zscore(A)
Z =
1.3770 -1.2509 -1.0585 0.8262
-0.6426 0.4811 0.2887 -0.0918
0.0918 -0.2887 -0.4811 0.6426
-0.8262 1.0585 1.2509 -1.3770
MU =
8.5000 8.5000 8.5000 8.5000
SIGMA =
5.4467 5.1962 5.1962 5.4467
>> mean(Z)
ans =
1.0e-016 *
-0.2776 0 0 0.5551
>> std(Z)
ans =
1.0000 1.0000 1.0000 1.0000
>> A=magic(4)
A =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> [Z,MU,SIGMA] = zscore(A)
Z =
1.3770 -1.2509 -1.0585 0.8262
-0.6426 0.4811 0.2887 -0.0918
0.0918 -0.2887 -0.4811 0.6426
-0.8262 1.0585 1.2509 -1.3770
MU =
8.5000 8.5000 8.5000 8.5000
SIGMA =
5.4467 5.1962 5.1962 5.4467
>> mean(Z)
ans =
1.0e-016 *
-0.2776 0 0 0.5551
>> std(Z)
ans =
1.0000 1.0000 1.0000 1.0000
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询