To calculate the eigenvalues of a 2 x 2 matrix [a b; c d]
by hand, you can use the characteristic equation:
main.m46 chars4 lines
where λ
is the eigenvalue.
To solve this equation, you need to find the determinant of the matrix |a - λ b |
and set it equal to zero:
main.m16 chars2 lines
where I
is the identity matrix of the same size as the matrix a
.
In Matlab, you can calculate the eigenvalues of a 2 x 2 matrix using the eig
function. Here's an example:
main.m38 chars3 lines
The variable eigenvalues
will contain the computed eigenvalues of the matrix a
.
main.m106 chars3 lines
gistlibby LogSnag