# Computing Eigenvectors in MATLAB

I am assigned to compute eigenvalues and eigenvectors in MATLAB of a 2x2 matrix: $$A = \left( \begin{matrix} 3 &0\\ 4 &5\\ \end{matrix} \right)$$

I know that the textbook's solution states that eigenvalue 3 corresponds to an eigenvector $(1 \; -2)$, and eig 5 corresponds to $(0 \; 1)$.

This is what I do. Why am I not getting the correct eigenvectors?

% Define the matrix
A = [3 0;4 5];

% Find Eigenvalues
E1 = eig(A);

% Display Eigenvalues
disp('Eigenvalues of the matrix A:')
E1

% Determine Eigenvectors
[V,D] = eig(A);

% V1 corresponds to eigenvalue 1 and V2 corresponds to eigenvalue 2
V1 = V(:,1)
V2 = V(:,2)

• A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). There's even syntax highlighting! – Mauro Vanzetto Sep 18 '17 at 10:07
• A tip: You can use MathJax to typeset your mathematical formulas. This will make the question much easier to read. – Mauro Vanzetto Sep 18 '17 at 10:08

If $x$ satisfies $Ax=\lambda x$, and hence is an eigenvector of $A$ corresponding to eigenvalue $\lambda$, then any multiple of $x$ also satisfies the equation, and hence is also an eigenvector of $A$ corresponding to eigenvalue $\lambda$.