% plot y=Ax, A 2x2 matrix, ||x||=1
n=128;
%A=rand(2,2);
A=randn(2,2);
x=[cos(2*pi*[0:n]/n);sin(2*pi*[0:n]/n)];
y=A*x;
for j=1:n
 y2(j)=norm(y(:,j),2);
end
[mmax,kmax]=max(y2);
[mmin,kmin]=min(y2);
subplot(1,2,1)
plot(x(1,:),x(2,:));
hold on;
plot([0 x(1,kmax)],[0,x(2,kmax)]);
hold on;
plot([0 x(1,kmin)],[0,x(2,kmin)]);
axis equal
hold on;
subplot(1,2,2)
plot(y(1,:),y(2,:))
hold on;
plot([0 y(1,kmax)],[0,y(2,kmax)]);
hold on;
plot([0 y(1,kmin)],[0,y(2,kmin)]);
axis equal
hold on;
