MTM/eye - Maple Help

MTM

 eye
 identity matrix
 speye
 sparse identity matrix

 Calling Sequence eye() eye(n) eye(n,m) eye(X) speye() speye(n) speye(n,m) speye(X)

Parameters

 n, m - positive integers X - list or array

Description

 • The eye function returns a dense identity matrix with specified dimensions.
 • The speye function returns a sparse identity matrix with specified dimensions.
 • If n is an integer and m is omitted, the resulting matrix is square.
 • If the input X is an array, its elements are used as the dimensions of the matrix.

Examples

 > $\mathrm{with}\left(\mathrm{MTM}\right):$
 > $\mathrm{eye}\left(4\right)$
 $\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {1}\end{array}\right]$ (1)
 > $\mathrm{eye}\left(4,5\right)$
 $\left[\begin{array}{ccccc}{1}& {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {1}& {0}\end{array}\right]$ (2)
 > $\mathrm{speye}\left(4\right)$
 $\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {1}\end{array}\right]$ (3)
 > $\mathrm{speye}\left(4,5\right)$
 $\left[\begin{array}{ccccc}{1}& {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {1}& {0}\end{array}\right]$ (4)