remove entries and shrink an Array
Remove( A, i)
Remove( A, a..b)
1-D Array or Vector
i, a, b
The Remove command deletes the entries at index i, or index range a..b. After this operation, upperbound(A) will be smaller by the number of elements deleted.
If A is an array or vector with an index range starting at zero or higher, then negative indexing can be used to specify the index to remove. For example, Remove(A,-1), will remove the last element, and Remove(A,-2..-1) will remove the last two elements.
This operation works in-place and will cause all references to A to be modified accordingly.
The Remove command only works on 1-D Arrays and Vectors with rectangular dense storage and no indexing function.
This function is part of the ArrayTools package, so it can be used in the short form Remove(..) only after executing the command with(ArrayTools). However, it can always be accessed through the long form of the command by using ArrayTools[Remove](..).
A ≔ Array⁡11,22,33,44,55
Remove A and shrink:
A is permanently changed:
Remove a range of elements
Remove the last element
Add some elements back
A⁡2 ≔ 55
A⁡3 ≔ 66
Remove the last two elements
The ArrayTools[Remove] command was introduced in Maple 2019.
For more information on Maple 2019 changes, see Updates in Maple 2019.
Download Help Document