1. Write a method
function [e1, v1, e2, v2] = eigenvectors(A)
to compute the two eigenvalues and eigenvectors of a 2x2 matrix, where A is a 2x2 matrix,
e1 and e2 are the eigenvalues, and v1 and v2 should be the corresponding 2x1 eigenvectors.
For this, you should
• Find the characteristic equation of the matrix.
• Solve for the two eigenvalues.
• Use the system of equations to find an eigenvector corresponding to each eigenvalue.
For this, you should assume that you are allowed to have complex eigenvalues and complex
eigenvectors, but you will never have a repeated eigenvalue.
To test your method, find the eigenvalues and eigenvectors for the matrices
$\begin{pmatrix} 2 & 1 \\ 1 & 0 \end{pmatrix}$ $\begin{pmatrix} 4 & 3 \\ 2 & -1 \end{pmatrix}$ $\begin{pmatrix} 1 & 2 \\ -2 & 1 \end{pmatrix}$