UnitVector - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

Student[LinearAlgebra]

 UnitVector
 construct a unit Vector

 Calling Sequence UnitVector[o](i, d, options)

Parameters

 [o] - (optional) use either [row] or [column] to specify the orientation of the resulting Vector i - positive integer; index of the nonzero entry d - positive integer; dimension of the resulting Vector options - (optional) parameters; for a complete list, see LinearAlgebra[UnitVector]

Description

 • The UnitVector(i, d) command returns a d-dimensional Vector in which the ith entry is one and all other entries are zero.
 • The UnitVector[row](i, d) command behaves like UnitVector(i, d) except that a row Vector is returned.  If the orientation option is omitted or if UnitVector[column](i, d) is used, a column Vector is returned.

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{LinearAlgebra}\right]\right):$
 > $\mathrm{UnitVector}\left(4,5\right)$
 $\left[\begin{array}{c}{0}\\ {0}\\ {0}\\ {1}\\ {0}\end{array}\right]$ (1)
 > $\mathrm{UnitVector}\left[\mathrm{row}\right]\left(1,3\right)$
 $\left[\begin{array}{ccc}{1}& {0}& {0}\end{array}\right]$ (2)

 See Also