Contents Previous Next Subchapters

Obtaining a Copy of the Identity Matrix (Mlmode)
Syntax eye(d)
eye(mn)
See Also identity , ones , zeros

Description
Returns an integer matrix with ones along the diagonal and zeros elsewhere. If the return value is a square matrix it is also an identity matrix. The arguments to eye are integer, real, double-precision or complex. If an argument is complex, only its real part is used.

eye(
d)
If d is a scalar, eye returns a d x d matrix. If d is a two element row vector, eye returns a d(1) x d(2) matrix.

eye(
mn)
eye returns a m x n matrix, where m and n are scalars.

Example
If in Mlmode you enter
     eye(2, 3)
O-Matrix will reply
     {
     [ 1 , 0 , 0 ]
     [ 0 , 1 , 0 ]
     }