Contents Previous Next Subchapters Current Chapters-> mlmode_setstr mlmode_strcmp mlmode_ones mlmode_zeros mlmode_length mlmode_ij mlmode_inf mlmode_nan mlmode_eye mlmode_exist mlmode_eps mlmode_clock mlmode_computer mlmode_cd mlmode_date mlmode_max mlmode_min Parent Chapters-> Omatrix6 mlmode mlmode_intrinsic mlmode_eye Search Tools-> contents reference index search

Obtaining a Copy of the Identity Matrix (Mlmode)
 Syntax `eye(`d`)` `eye(`m`, `n`)` 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(```m`, `n```) ````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 ]      } ```