Please enable JavaScript to view this site.

Knowledge Base

Navigation: Scripting Language > Manipulating variables

eye

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

Creates a 2D identity matrix.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

I = eye;

Returns a 1x1 matrix, value 1.0.

I = eye(n);

Returns nxn identity matrix.

I = eye(n,m);

Returns nxm matrix with ones on main diagonal

 

Examples

 

Following are some examples and the results of the script command usage.

?eye;

result: 

 

?eye(3);

result: 

1 0 0 

0 1 0 

0 0 1 

 

?eye(2,3);

result: 

1 0 0 

0 1 0 

 

?eye(3,2);

result: 

1 0 

0 1 

0 0 

 

See Also

Datasets, matrixdataset, rectilineardataset, matlab, matrix

Copyright Lumerical Inc. | Privacy | Site Map