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

Online Help

All Products    Maple    MapleSim


ArrayTools

  

Insert

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Insert(A,pos,expr,opts)

Parameters

A

-

Array or Vector

pos

-

position to insert

expr

-

expression to insert

opts

-

(optional) inplace=true or inplace=false

Options

• 

inplace = true or false

  

Specifies whether the insert operation should reuse the existing Array or generate a new Array. The default value is true.

Description

• 

The Insert(A,pos,expr) command inserts the expression expr into the Vector or the 1-D Array A at the position pos.

• 

If there is already a value at position pos, this value and all remaining values are shifted rightwards in the array.

• 

If the position pos is beyond the bounds of the array, then the array's size will be increased and any new elements in between exisiting elements and the inserted entry will be initialized to zero.

• 

When inplace=false is specified, the insert operation 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 Insert(..) only after executing the command with(ArrayTools). However, it can always be accessed through the long form of the command by using ArrayTools[Insert](..).

Examples

withArrayTools:

AArray2,3,5

A235

(1)

InsertA,2,1x

21x35

(2)

InsertA,3,sinx

21xsinx35

(3)

v1,2x

v12x

(4)

Insertv,2,3x2,inplace=false

13x22x

(5)

v

12x

(6)

A2Array3..2,7,8

InsertA2,3,6

A23

6

(7)

Compatibility

• 

The ArrayTools[Insert] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

ArrayTools

ArrayTools[Append]

ArrayTools[Extend]