identity - Maple Help

The identity Indexing Function

Description

 • The identity indexing function can be used to construct tables and rtable objects of type Array or Matrix.
 • In general, the identity indexing function returns 1 for all entries whose indices are identical, and returns 0 otherwise.
 • If an object is defined by using the identity indexing function, its elements cannot be reassigned.
 In the case of a table, if you know that the elements may be reassigned, use the sparse indexing function instead.
 • Under normal circumstances, no storage is allocated for the entries of an object constructed by using the identity indexing function. To override this, specify a storage value.

Examples

 > $M≔\mathrm{Matrix}\left(3,3,\mathrm{shape}=\mathrm{identity}\right)$
 ${M}{≔}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]$ (1)
 > $M\left[1,2\right]≔3$