for n=1:20,
for j=1:100,
A=randn(n);B=randn(n,1);L=randn(n,1);F=acker(A,B,L);
Lcomp=eig(A-B*F);err(n,j)=norm(sort(L)-sort(Lcomp))/norm(L);
%Lr=randn(n,1);errR(n,j)=norm(sort(L)-sort(Lr));
end 
end
figure(1),set(1,'position',[10,312,512,284])
%figure(2),set(2,'position',[512,312,512,284])
figure(1),semilogy(err),title('Relative Error by Ackermans (matlab) formula')
xlabel('Order of the system'),v=axis;
%figure(2),semilogy(errR),axis(v),title('Random error')
%xlabel('Order of the system')