eig

Linear Algebra

Eigenvalues and eigenvectors of a square matrix. Returns eigenvalues as a vector, or both eigenvectors (V) and a diagonal eigenvalue matrix (D).

Syntax

d = eig(A)
[V, D] = eig(A)

Examples

A = [1 2; 3 4]; eig(A)
▶ Run
B = [2 -1 0; -1 2 -1; 0 -1 2]; eig(B)
▶ Run
A = [4 1; 2 3]; eig(A)
▶ Run

See Also

Try SimLab — Free MATLAB® Alternative

466 functions. Runs in your browser. No install.

Open SimLab

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.