x = normrnd(0,10,[1 400]);
noise= normrnd(0,1,[1 400]);
y=x
y=y+noise
w=[x;y]
[coeff,scores] = pca(w')
figure(1)
hold on
scatter(x(:), y(:), '.')
biplot(coeff(:,1:2)*50,'varlabels',{'v_1','v_2'});%一行表示一个方向scatter(x(:), y(:), '.')
new=w'*coeff'
figure(2)
w=zeros(400,1)
scatter(new(:,1)',new(:,2)', '.')
figure(3)
st=std(new)
st1=repmat(st,400,1)
new=new./st1
scatter(new(:,1)',new(:,2)', '.')