 
 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',16,'interpreter','latex')
 xlabel('$t$','fontsize',16,'interpreter','latex');
 xlim([min(t) max(t)]), ylim([-2 5])
 set(gca,'fontsize',16)

 
 figure(2), clf
 scl=3
 plot3(scl*[-1 1],scl*[-1 1],scl*[0 0],'r-','linewidth',4), 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',22);
 hold on
 grid on
 title('Space of Hermitian $2\times 2$ matrices','fontsize',16,'interpreter','latex');
 scl = 1.5;
 leg=legend('double eigenvalues','$A(t)$','location','southoutside','orientation','horizontal')
 set(leg,'fontsize',16,'interpreter','latex')

 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',22);
 end

