ang = -25*pi/180;
fs = 18;
lam = [5 0;0 1];
u = [cos(ang) sin(ang); -sin(ang) cos(ang)];
cv = u*lam*u';
z1 = sqrt(5)*randn(1,300);
z2 = sqrt(1)*randn(1,300);
y= u*[z1;z2];
plot(y(1,:)+2,y(2,:)+3,'+')
axis([-3 7 -2 8],'square')
v = u*5;
line([-v(1,1) v(1,1)]+2,[-v(2,1) v(2,1)]+3)
line([-v(1,2) v(1,2)]+2,[-v(2,2) v(2,2)]+3)
text(v(1,1)+2,v(2,1)+2.8,'y1','FontSize',fs)
text(v(1,2)+2.2,v(2,2)+3,'y2','FontSize',fs)
grid on
xlabel('x1','FontSize',fs);
ylabel('x2','Fontsize',fs);
set(gca,'Fontsize',fs)
print -dpsc test.ps
print -depsc2 test.eps
