[TOC]

eig

Eigenvalues and eigenvectors

Introduction

Let be a square matrix. The scalar and vector that satisfy the following equation are called eigenvalue and eigenvector, respectively:

An matrix has different eigenvalues, where . There can be more than one eigenvectors associated with an eigenvalue.

Usages

d = eig(A)

[V, D] = eig(A)

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

Examples

Input
a = rand(10);
cplxpair(eig(a))
Output
ans =
-0.4109130 - 0.6592851i
-0.4109130 + 0.6592851i
 0.1072426 - 0.2233978i
 0.1072426 + 0.2233978i
 0.4336722 - 0.6942055i
 0.4336722 + 0.6942055i
-0.3721263 + 0.0000000i
-0.1895444 + 0.0000000i
 0.5893938 + 0.0000000i
 5.6223728 + 0.0000000i
Input
A = rand(4);
[V,D]=eig(A);
A*V(:,2)
D(2,2)*V(:,2)
Output
ans = 1e-1 ×
-2.3628584 + 1.3160677i
 1.1303095 - 1.2702069i
 1.1515366 + 2.1725013i
-0.0463397 - 1.7423500i

ans = 1e-1 ×
-2.3628584 + 1.3160677i
 1.1303095 - 1.2702069i
 1.1515366 + 2.1725013i
-0.0463397 - 1.7423500i
Input
A = rand(4);
[V,D,W] = eig(A);
W(:,2)'*A
D(2,2)*W(:,2)'
Output
ans = 1e-2 ×
 0.7739085  -0.3822298   0.0919348  -1.4037180

ans = 1e-2 ×
 0.7739085  -0.3822298   0.0919348  -1.4037180