 
 A = [2 -1 ; -1 2];

 randn('seed',9214);
 scl = 2;
 E = randn(2); E = E+E';

 t = linspace(-1,1,100);

 figure(1), clf
 plot(t(1)*[1 1], eig(A+t(1)*E),'k.','markersize',8); hold on
 ylabel('eigenvalues of $A(t)$','fontsize',14,'interpreter','latex')
 xlabel('$t$','fontsize',14,'interpreter','latex');
 xlim([min(t) max(t)]), ylim([-2 5])
 
 figure(2), clf
 plot3(scl*[-1 1],scl*[-1 1],scl*[0 0],'r-','linewidth',2), hold on
 axis equal, axis(scl*[-1 1 -1 1 -1 1]), box on
 At = A+t(1)*E;
 plot3(At(1,1),At(2,2),At(1,2),'b.','markersize',12);
 grid on
 title('Space of Hermitian $2\times 2$ matrices','fontsize',14,'interpreter','latex');
 scl = 1.5;
 legend('double eigenvalues','A(t)','location','southoutside','orientation','horizontal')

 for k=1:length(t)
    At = A+t(k)*E;
    figure(1), plot(t(k)*[1 1], eig(At),'k.','markersize',8);
    figure(2), plot3(At(1,1),At(2,2),At(1,2),'b.','markersize',12);
 end

