David
Farruggio

MathGenie

eye

Identity matrix

Syntax and Description

eye returns the scalar, 1.
eye() returns the scalar, 1.
eye(n) returns an n-by-n identity matrix with ones on the main diagonal and zeros elsewhere.
eye(m,n) returns an m-by-n matrix with ones on the main diagonal and zeros elsewhere.
eye([m,n]) returns an m-by-n matrix with ones on the main diagonal and zeros elsewhere.

Back to functions