# matlab var std,Matlab var std cov 函数解析

p = [-0.92 0.73 -0.47 0.74 0.29; -0.08 0.86 -0.67 -0.52 0.93]p =

-0.9200    0.7300   -0.4700    0.7400    0.2900

-0.0800    0.8600   -0.6700   -0.5200    0.9300

var(p(1,:))ans =

0.5511

var(p(1,:),0)

ans =

0.5511

sum((p(1,:)-mean(p(1,:))).^2)/(length(p(1,:))-1)ans =

0.5511

var(p(1,:),1)ans =

0.4409

sum((p(1,:)-mean(p(1,:))).^2)/(length(p(1,:)))ans =

0.4409

var没有求矩阵的方差功能，可使用std先求均方差，再平方得到方差。

std，均方差，std(p,0,1)求列向量方差，std(p,0,2)求行向量方差。

std(p(1,:))

ans =

0.7424

sqrt(var(p(1,:)))

ans =

0.7424

std(p,0,2)

ans =

0.7424   % std(p(1,:))

0.7543   %std(p(2,:))

std(p,0,1)

ans =

0.5940    0.0919    0.1414    0.8910    0.4525

std2(p)

ans =

0.7058

A=[61.45,55.9,61.95,59,58.14,53.61,55.48,54.21,61.52,54.92];B=[40.36,39.8,49.2,48,51.5,49.39,51.13,58.06,61,62.35];C=[8.61,8.91,10.43,13.32,13.48,15.75,18.14,19.95,21.95,23.53];D=[14.31,14.72,15.28,15.91,14.67,15,15.86,15.16,13.72,12.94];E=[7.67,7.75,8.15,9.24,10.68,10.58,10.31,10,8.91,8.51];>> q=[A',B',C',D',E'];>> w=cov(q)w =10.3710   -4.7446   -6.6023   -0.1873   -1.8881-4.7446   59.1503   38.7606   -3.0743    3.0982-6.6023   38.7606   28.6966   -2.0199    2.4166-0.1873   -3.0743   -2.0199    0.8474    0.3936-1.8881    3.0982    2.4166    0.3936    1.3412

07-16 1929

07-24 2万+
03-09 1万+
03-25 6725
12-23 238
07-29 1万+
01-17 388
01-30 4596
09-26 1万+
06-07 440
07-22 965
03-01 2659
12-28 72
06-05 9887
12-31
©️2020 CSDN 皮肤主题: 深蓝海洋 设计师:CSDN官方博客