eye

Type: External

Group: matrix

Syntax

matrix = eye(size)

Description

returns a matrix with the specified size.

Examples

eye(2) = [1,0;0,1]
eye(3) = [1,0,0;0,1,0;0,0,1]

See Also

ones, zeros