Extend - Maple Help

ArrayTools

 Extend

 Calling Sequence Extend(A,B,inplace)

Parameters

 A - Array or Vector B - list, Array, or Vector, elements to append to A opts - (optional) inplace=true or inplace=false

Options

 • inplace = true or false
 Specifies whether the extend operation should reuse the existing Array or generate a new Array. The default value is true.

Description

 • The Extend(A,B) command extends the Vector or the 1-D Array, A, by the elements in B.
 • When inplace=false is specified, Extend allocates a new Array and does not modify the existing one.  Otherwise, the existing object is modified.
 • This function is part of the ArrayTools package, so it can be used in the short form Extend(..) only after executing the command with(ArrayTools. However, it can always be accessed through the long form of the command by using ArrayTools[Extend](..).

Examples

 > $\mathrm{with}\left(\mathrm{ArrayTools}\right):$
 > $A≔\mathrm{Array}\left(\left[1,2,3\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\end{array}\right]$ (1)
 > $\mathrm{Extend}\left(A,\left[4,5\right]\right)$
 $\left[\begin{array}{ccccc}{1}& {2}& {3}& {4}& {5}\end{array}\right]$ (2)
 > $B≔⟨\mathrm{sin}\left(x\right),\mathrm{cos}\left(x\right)⟩$
 ${B}{≔}\left[\begin{array}{c}{\mathrm{sin}}{}\left({x}\right)\\ {\mathrm{cos}}{}\left({x}\right)\end{array}\right]$ (3)
 > $\mathrm{Extend}\left(A,B\right)$
 $\left[\begin{array}{ccccccc}{1}& {2}& {3}& {4}& {5}& {\mathrm{sin}}{}\left({x}\right)& {\mathrm{cos}}{}\left({x}\right)\end{array}\right]$ (4)
 > $v≔\mathrm{Vector}\left[\mathrm{row}\right]\left(\left[75,46,32,73,46\right]\right):$
 > $\mathrm{Extend}\left(v,⟨32,66,111,115⟩,\mathrm{inplace}=\mathrm{false}\right)$
 $\left[\begin{array}{ccccccccc}{75}& {46}& {32}& {73}& {46}& {32}& {66}& {111}& {115}\end{array}\right]$ (5)
 > $v$
 $\left[\begin{array}{ccccc}{75}& {46}& {32}& {73}& {46}\end{array}\right]$ (6)

Compatibility

 • The ArrayTools[Extend] command was introduced in Maple 18.