eyeΒΆ

eye returns an identity matrix.

rmDiag = eye(n)

Return Value

rmDiag is a matrix with ones on the diagonal and 0 elsewhere.

Parameters

n

n is the number of rows and columns.

Example

* eye(3)
    1.0000     0.0000     0.0000
    0.0000     1.0000     0.0000
    0.0000     0.0000     1.0000

id-2003046