Loading [MathJax]/jax/output/HTML-CSS/config.js
lettura simple

Eigenvalues in Matlab

In this lesson, I will explain how to calculate eigenvalues in Matlab.

What are eigenvalues? Eigenvalues are the solutions of the characteristic equation of a square matrix.

Let's take a practical example.

Create a 2x2 square matrix.

>> M = [ 1 2 ; 0 3 ]
M =
1 2
0 3

To calculate the eigenvalues of the matrix, type the eig(M) function.

>> eig(M)
ans =
1
3

The eigenvalues of the square matrix are 1 and 3.

Verify. Consider the square matrix M $$ M = \begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix} $$ The characteristic polynomial PM(λ) of matrix M is the determinant of M-λ·Id: $$ P_M(λ) = \det(M-\lambda \cdot Id) $$ where M is the given square matrix, Id is an identity matrix of the same order, and λ is an unknown variable. $$ P_M(λ) = \det [ \begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix} -\lambda \cdot \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} ] $$ $$ P_M(λ) = \det [ \begin{pmatrix} 1 & 2 \\ 0 & 3 \end{pmatrix} - \begin{pmatrix} \lambda & 0 \\ 0 & \lambda \end{pmatrix} ] $$ $$ P_M(λ) = \det \begin{pmatrix} 1- \lambda & 2 \\ 0 & 3-\lambda \end{pmatrix} $$ $$ P_M(λ) = (1-\lambda) \cdot (3-\lambda)$$ $$ P_M(λ) = 3 - \lambda - 3 \lambda + \lambda^2 $$ $$ P_M(λ) = \lambda^2 - 4 \lambda + 3 $$ The characteristic equation of the matrix is the characteristic polynomial P(λ) = 0 equal to zero: $$ P_M(λ) = 0 $$ $$ \lambda^2 - 4 \lambda + 3 = 0 $$ The eigenvalues are the solutions of the characteristic equation, which in this case is a quadratic equation. $$ \lambda = \frac{-b \pm \sqrt{b^2-4ac}}{2a} $$ $$ \lambda = \frac{-(-4) \pm \sqrt{(-4)^2-4 \cdot 1 \cdot 3}}{2 \cdot 1} $$ $$ \lambda = \frac{4 \pm \sqrt{16-12}}{2} $$ $$ \lambda = \frac{4 \pm \sqrt{4}}{2} $$ $$ \lambda = \frac{4 \pm 2}{2} = \begin{cases} \lambda_1 = \frac{4-2}{2} = 1 \\ \\ \lambda_2 = \frac{4+2}{2} = 3 \end{cases} $$ The eigenvalues of the matrix are 1 and 3. The result is correct.




Report a mistake or post a question




FacebookTwitterLinkedinLinkedin