 N = 50;


 L = diag([1:N]);
 Q = orth(randn(N));
 A = Q'*L*Q;            % generate a matrix with eigenvalues 1:N

 A = 2*eye(N)-diag(ones(N-1,1),1)-diag(ones(N-1,1),-1);

 ew = eig(A);
 figure(1), clf
 for k=1:N
    plot(ew*[1 1],[0 N+1],'-','linewidth',1.5,'color',[1 .5 .5]), hold on
 end
 spread = max(ew)-min(ew);
 xlim([min(ew)-spread/10 max(ew)+spread/10])
 ylim([0 N+1])
 for k=1:N
    theta = eig(A(1:k,1:k));
    plot(theta, k*ones(1,k), 'b.','markersize',15)
    pause
 end 
