Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Eigenvalues and eigenvectors

`e = eig(A)`

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

```
[V,D,W]
= eig(A)
```

`e = eig(A,B)`

```
[V,D] =
eig(A,B)
```

```
[V,D,W]
= eig(A,B)
```

`[___] = eig(A,balanceOption)`

`[___] = eig(A,B,algorithm)`

`[___] = eig(___,eigvalOption)`

`[`

also returns full matrix `V`

,`D`

,`W`

]
= eig(`A`

)`W`

whose
columns are the corresponding left eigenvectors, so that ```
W'*A
= D*W'
```

.

The eigenvalue problem is to determine the solution to the equation *A**v* = *λ**v*,
where *A* is an `n`

-by-`n`

matrix, *v* is
a column vector of length `n`

, and *λ* is
a scalar. The values of *λ* that satisfy the
equation are the eigenvalues. The corresponding values of *v* that
satisfy the equation are the right eigenvectors. The left eigenvectors, *w*,
satisfy the equation *w*’*A* = *λ**w*’.

`[`

also
returns full matrix `V`

,`D`

,`W`

]
= eig(`A`

,`B`

)`W`

whose columns are the corresponding
left eigenvectors, so that `W'*A = D*W'*B`

.

The generalized eigenvalue problem is to determine the solution
to the equation *A**v* = *λ**B**v*,
where *A* and *B* are `n`

-by-`n`

matrices, *v* is
a column vector of length `n`

, and *λ* is
a scalar. The values of *λ* that satisfy the
equation are the generalized eigenvalues. The corresponding values
of *v* are the generalized right eigenvectors. The
left eigenvectors, *w*, satisfy the equation *w*’*A* = *λ**w*’*B*.

`[___] = eig(`

,
where `A`

,`balanceOption`

)`balanceOption`

is `'nobalance'`

,
disables the preliminary balancing step in the algorithm. The default for
`balanceOption`

is `'balance'`

, which
enables balancing. The `eig`

function can return any of the
output arguments in previous syntaxes.

`[___] = eig(`

,
where `A`

,`B`

,`algorithm`

)`algorithm`

is `'chol'`

, uses
the Cholesky factorization of `B`

to compute the
generalized eigenvalues. The default for `algorithm`

depends
on the properties of `A`

and `B`

,
but is generally `'qz'`

, which uses the QZ algorithm.

If `A`

is Hermitian and `B`

is
Hermitian positive definite, then the default for `algorithm`

is `'chol'`

.

`[___] = eig(___,`

returns
the eigenvalues in the form specified by `eigvalOption`

)`eigvalOption`

using
any of the input or output arguments in previous syntaxes. Specify `eigvalOption`

as `'vector'`

to
return the eigenvalues in a column vector or as `'matrix'`

to
return the eigenvalues in a diagonal matrix.

The

`eig`

function can calculate the eigenvalues of sparse matrices that are real and symmetric. To calculate the eigenvectors of a sparse matrix, or to calculate the eigenvalues of a sparse matrix that is not real and symmetric, use the`eigs`

function.