
 A = inline('[exp(t)-1 t^2; t^2 cos(pi*t)]','t');
 scl = 2;

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

 figure(1), clf
 plot(t(1)*[1 1], eig(A(t(1))),'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
 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));
 plot3(At(1,1),At(2,2),At(1,2),'b.','markersize',12);
 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));
    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

