eye

Creates an identity matrix.

Syntax

  • R = eye

  • R = eye(n)

  • R = eye(n, m)

  • R = eye(n, m, ..., z)

  • R = eye(n, m, ..., z, 'like', V)

  • R = eye(n, m, ..., z, classname)

Input argument

  • n - a variable: n-by-n matrix

  • m - a variable: n-by-m matrix

Description

eye returns an identity matrix.

Examples

eye(3)
eye(3,1,3,'single')
A = single([3 3])
B = eye(2,4,'like', A)
A = eye(0, 4)

See also

ones, zeros.

History

Version
Description

1.0.0

initial version

Author

Allan CORNET

Last updated