eye(n)

The eye(n) function returns an n x n matrix with 1’s on the diagonal.

Examples

OML

>> eye(4)

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

Block