Please enable JavaScript to view this site.

Knowledge Base

Navigation: Scripting Language > Functions

eig

We've made some changes. Use 'Ctrl-F5' to clear your browser cache.
Scroll Prev Top Next More

Finds the eigenvalue and/or eigenvector of a matrix. The matrix has to be square.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

out = eig(A);

out = eig(A, 1);

Returns the eigenvalues of matrix A.

out = eig(A, 2);

Returns the eigenvectors of matrix A.

out = eig(A, 3);

Returns both the eigenvalues and eigenvectors of matrix A.

 

 

Example

A simple example showing the different options for the results from the eigenvalue calculation.

A = [ 1, 2; 2, 4];

 

?eig(A);

result: 

 

 

?eig(A,1);

result: 

 

 

?eig(A,2);

result: 

-0.894427 -0.447214 

0.447214 -0.894427 

 

 

?eig(A,3);

result(i,j,1):

0 0 

0 5 

 

result(i,j,2):

-0.894427 -0.447214 

0.447214 -0.894427 

 

 

See Also

Operators, =, ==, !=, <=, >=, <, >, &, and, |, or, !, ~ , mult, permute, reshape, inv

Copyright Lumerical Inc. | Privacy | Site Map