eig
Eigenvalues and eigenvectors.
Syntax
Section titled “Syntax”e = eig(A)[V, D] = eig(A)[V, D] = eig(A, B) % generalized: A*V = B*V*D[V, D] = eig(A, 'nobalance')Description
Section titled “Description”With one output, returns the eigenvalues of A as a column vector. With two outputs, returns matrix V of eigenvectors and diagonal matrix D of eigenvalues such that A*V = V*D.
When A is detected to be Hermitian (or symmetric for real input), uses the symmetric eigensolver — guaranteed real eigenvalues and orthogonal eigenvectors. Otherwise uses the general eigensolver.
The two-matrix form solves the generalized eigenvalue problem: A*V = B*V*D. Pass 'nobalance' as the second argument to skip the balancing step (sometimes useful for matrices with widely-varying entries where balancing introduces numerical noise).
Examples
Section titled “Examples”A = [2 0; 0 3];eig(A) % [2; 3][V, D] = eig(magic(3));norm(magic(3)*V - V*D) % near-zero