[Math] MATLAB Eigenvalues

eigenvalues-eigenvectorsMATLABmatrices

So I am trying to get matlab to output the correct eigenvalue/eigenvector of a matrix. The matrix is:
\begin{array}{ccc}
0 & 1 \\
-3 & -4 \end{array}

The eigenvalues are:
$\lambda_1 = -1, \lambda_2=-3$

Therefore the eigenvector that I calculated and that wolframalpha verifies is:
\begin{array}{ccc}
1 & 1 \\
-1 & -3 \end{array}

However, when I run the following matlab code:

A = [0 1; -3 -4;];
[T,lambda] = eig(A)

I get the following as the output:

T =

    0.7071   -0.3162
   -0.7071    0.9487

I understand that the ratios are correct (i.e $\frac{-.3162}{.9487}=-3$) but I want it to output the eigenvector as whole numbers like how I calculated above. Is there anyway to do that?

Best Answer

The eigenvalues that Matlab gives you are normalized to have a magnitude of 1 (i.e. they are all stated as unit vectors). You can prove this to yourself like this:

A = [0 1; -3 -4;];
[T,lambda] = eig(A);

sqrt(sum(T.^2))

which gives a vector of 1s.

I'm assuming that the eignvectors you are looking for a normalized to have 1 as the value of their first component. You can scale the Matlab eigenvectors into the form you desire by dividing each vector by it's first element, which is vectorized using the bsxfun function in Matlab:

bsxfun(@rdivide, T, T(1,:))

which results in

ans =

     1     1
    -1    -3
Related Question