`y=eye(n)`

`y=eye(m,n,p,...)`

`y=eye(vec)`

Inputs | |

`n` |
a scalar integer |

`m` |
a scalar integer |

`p` |
a scalar integer |

`vec` |
a vector of integers |

Outputs | |

`y` |
an indentity matrix or a multi-dimensional array of ones on the main diagonal as defined below. |

`eye(m)`

, with `m`

an integer scalar, returns an `m`

by `m`

identity matrix.
`eye(m,n)`

, with `m`

and `n`

integer scalars, returns an `m`

by `n`

matrix
with ones in the main diagonal, meaning that all the elements
of the form `a[i,i]`

of the output with `1<= i <= min(m,n)`

are
all ones.
`eye(m,n,p,...)`

, with `m`

and `n, p, ..`

integer scalars,
returns an `m`

by `n`

by `p`

.... array
with ones in the main diagonal, meaning that all the elements
of the form `a[i,i,i,...]`

of the output `a`

with
`1<= i <= min(m,n,p,...)`

are ones.
`eye(x)`

, with `x`

a vector, is equivalent to `eye(x[1], x[2], ...)`

.