据说这要手算,sad

clear;
a = [65 45  27.6
70  45  30.7
70  48  31.8
69  46  32.6
66  50  31
67  46  31.3
68  47  37
72  43  33.6
66  47  33.1
68  48  34.2
];
n=10;
sum = 0;

one = ones(n,1);
%bb = 1/n * a'* one; % the mean formula
b=mean(a)';
hermitian = one*one';
cc = a'*(eye(n)-1/n*hermitian)*a;

c=a'*a-n*b*b'%why not ok
%ss=cc/(10-1)
s=cov(a);
ccc = (n-1)*s;
for i=1:3
    for j=1:3
        R(i,j) = s(i,j)/(sqrt(s(i,i))*sqrt(s(j,j)));
    end
end

你可能感兴趣的:(据说这要手算,sad)