Pregunta

I have a 2x2 matrix of [ 1 2; k 3],

and k is integer between [0,5].

I want to plot the eigenvalues of this matrix as a function of k in the range of [0,5].

How do I do that?

¿Fue útil?

Solución

Have a look at this:

   figure();  
   hold on;      
   for k = 0:5  
        plot (ones(2, 1)*k, eig([ 1 2; k 3]), 'o');   
   end
   grid on;
   xlabel('k'), ylabel('eigenvalue');

enter image description here

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top