eye(width, height, fill)

Unit matrix.

eye(3)
widthThe width of the matrix.
heightThe height of the matrix (optional) If not given, assumed to be the same as the width.
fillFill diagonal with these elements (optional). If not given, assumed to be 1.
return valueThe generated matrix.

The number of arguments may vary. If only 1 is provided, it specifies the dimension of the square matrix generated. The diagonal will be all ones.

If the number of arguments is 2, it will generate a rectangular matrix the dimensions of which are specified by the arguments. There will be ones in the diagonal, and the rest will be 0.

If 3 parameters are given, it's similar to 2 parameters, except for the diagonal being filled with the third argument instead of ones.

eye(3,2,4)