~Array - Maple Programming Help

~Array

coerce to an Array

~Matrix

coerce to a Matrix

~Vector

coerce to a Vector

 Calling Sequence ~Array(a, options ) ~Matrix(a, options ) ~Vector(a, options ) ~Vector[row](a, options ) ~Vector[column](a, options )

Parameters

 a - any expression options - (optional) bounds, datatype, order, etc.

Description

 • These functions accept any expression, a, and try to coerce it to the type implied by their base name and options. They are often used in conjunction with coercion, a part of procedure parameter processing, but can also be called directly.
 • Coercion may succeed if a is any of the following types: list, listlist, Matrix, matrix, Vector, vector, Array.  If coercion succeeds, the result will look very much the same as the original input. If coercion fails, the result will be NULL.
 • The result may be an alias of the input argument.  An alias is simply a different view of the same data.  This is memory efficient as no copy operation is involved.  It also means that modifying the result will change the input.  This is especially desirable when used in conjunction with parameter processing.

 • The ~Array, ~Matrix and ~Vector commands are thread-safe as of Maple 16.

Examples

 > $\mathrm{~Matrix}\left(\left[\left[1,2\right],\left[3,4\right]\right]\right)$
 $\left[\begin{array}{cc}{1}& {2}\\ {3}& {4}\end{array}\right]$ (1)
 > $v≔\mathrm{Vector}\left(\left[1,2,3\right]\right)$
 ${v}{≔}\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$ (2)
 > $\mathrm{~Matrix}\left(v\right)$
 $\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$ (3)
 > $\mathrm{~Matrix}\left(v,\mathrm{datatype}=\mathrm{float}\right)$
 $\left[\begin{array}{c}{1.}\\ {2.}\\ {3.}\end{array}\right]$ (4)
 > $\mathrm{A1}≔⟨1,2,3⟩$
 ${\mathrm{A1}}{≔}\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$ (5)
 > $\mathrm{A0}≔\mathrm{~Array}\left(\mathrm{A1},0..\right)$
  (6)
 > $\mathrm{A0}\left[0\right]$
 ${1}$ (7)
 > $\mathrm{A0}\left[0\right]≔5$
 ${{\mathrm{A0}}}_{{0}}{≔}{5}$ (8)
 > $\mathrm{A1}\left[1\right]$
 ${5}$ (9)

Compatibility

 • The ~Array, ~Matrix and ~Vector commands were introduced in Maple 16.
 • For more information on Maple 16 changes, see Updates in Maple 16.