You can calculate eigenvectors of a matrix with eig() function like this:

[eigenvectors, eigenvalues] = eig (matrix)

But I can't manage to understand why the eigenvector output is in some kind of unitary module format.

Example:

Matrix: $$\left(\begin{matrix} 2 & -4\\ -1 & -1\end{matrix}\right)$$

Eigenvalues output of the function: $$\left(\begin{matrix} 3 & 0\\ 0& -2\end{matrix}\right)$$

(I get it, -2 and 3 are the eigenvalues, they are in the main diagonal)

Eigenvectors output of the function: $$\left(\begin{matrix} 0.97014& 0.70711\\ -0.24254 & 0.70711\end{matrix}\right)$$ Why those values instead of the eigenvectors?: $$\left(\begin{matrix} -4\\ 1\end{matrix}\right)$$ and

$$\left(\begin{matrix} 1\\ 1\end{matrix}\right)$$

closed as off-topic by Lord_Farin, Bill Dubuque, PhoemueX, user7530, Semiclassical Feb 4 '15 at 23:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is not about mathematics, within the scope defined in the help center." – Lord_Farin, Bill Dubuque, PhoemueX, user7530, Semiclassical
If this question can be reworded to fit the rules in the help center, please edit the question.

  • If you want eigenvectors more along the lines of how a human would calculate them, you can try using symbolic math in Matlab: A=sym([2 -4;-1 -1]) [V,D]=eig(A). This uses sym/eig (documentation). – horchler Feb 4 '15 at 21:22
  • It seems Octave sym function has a different syntax, I downloaded the symbolic package but I get an error when trying to insert the matrix: warning: range error for conversion to character value warning: implicit conversion from matrix to sq_string – user213028 Feb 4 '15 at 21:54
  • Octave's symbolic math is well behind Matlab's. It may not support matrices. Or you may need to specify the matrix as a string, i.e., A=sym('[4,1;-1,-1]'), which is generally deprecated syntax in Matlab. In any case I recommend that you read Octave's documentation. – horchler Feb 5 '15 at 1:10
  • 1
    Also, while your question relates to Matlab programming, I think you have a case for asking that it be reopened. The accepted answer makes this clear. – horchler Feb 5 '15 at 1:12
up vote 5 down vote accepted

Eigenvectors are determined only up to a scaling by a constant multiplier. So for an eigenvector $(1,1)$, the vectors $(2,2)$ and $(0.5,0.5)$ are the same eigenvector. It looks like Matlab chooses to normalize the eigenvectors to unit norm. This normalization is the most commonly used.

  • Thank you, I'm new to algebra tools, if only I could get the output "more along the lines of how a human would calculate them" as horchler said... – user213028 Feb 4 '15 at 21:58
  • For that, you might be more interested in using Mathematica. For exactly represented matrices (integer or symbolic entries), it will return eigenvalues and eigenvectors in exact representations whenever possible. In this case, it usually normalizes one entry of the vector to 1, so it would return $(1,1)$ and $(-4,1)$, but possibly $(1,-\frac{1}{4})$. – Victor Liu Feb 4 '15 at 22:08
  • Thank you very much, I will try it. – user213028 Feb 4 '15 at 22:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.