Method on @sym: eye (n)
Method on @sym: eye (n, m)

Return an identity matrix.

Example:

y = eye (sym(3))
  ⇒ y = (sym 3×3 matrix)
      ⎡1  0  0⎤
      ⎢       ⎥
      ⎢0  1  0⎥
      ⎢       ⎥
      ⎣0  0  1⎦

See also: eye, @sym/zeros, @sym/ones.

Package: symbolic