identity

identity(n)

identity(m, n)

identity([m, n])

Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.

Try it yourself:

All functions