Generates an identity matrix.
EYE(numrows, numcols)
numrows |
- |
An integer. The number of output rows. |
numcols |
- |
Optional. An integer, the number of output columns. Defaults to numrows. |
The NxN or NxM identity matrix.
eye(3)
creates the 3x3 matrix:
{{1, 0, 0},
{0, 1, 0},
{0, 0, 1}}
eye(3,2)
creates the 3x2 matrix:
{{1, 0},
{0, 1},
{0, 0}}
EYE uses DIAG to create the identity matrix.