% example for pseudospectral computations
% using random perturbations of prescribed norm
% the example is a Toeplitz matrix

N=64;
AA=toeplitz([0 1/4 zeros(1,N-2)],[0 1 zeros(1,N-2)]);
iter=500;
myeps=10^(-10);
figure
title(['Matrix size N=',num2str(N),'  Number of iterations ', num2str(iter), '   Epsilon=', num2str(myeps)])
hold on
plot(eig(AA),zeros(1,N),'.r','MarkerSize',20)
for k=1:iter
    E=rand(N)-0.5*ones(N);
    E=(E./norm(E)).*myeps*rand(1);
    spec=eig(AA+E);
    plot(real(spec),imag(spec),'.b','MarkerSize',2)
end
hold off
axis equal
axis([-1.25 1.25 -1 1])
    
