Definition: Insert is a GeoGebra LIST command.
Insert[ <List>, <List>, <Position> ]
Insert[ <Object>, <List>, <Position> ]
See also list commands:
  • Join for joining 2 or more lists into a new list.
  • Append for inserting a single object at the beginning or end of a list.

Insert - USE
Insert[Object, List, Position]: Creates a new list with the object inserted into the list at the given position.
  • Example: Insert[x^2, {1, 2, 3, 4, 5}, 3] places x2 at the third position and creates the list {1, 2, x2, 3, 4, 5}.
    • We point out that this last list is garbage:
In the applet below: list3=list1-1={0,1,2,3,4} is well-defined but list3=list2-1={} is empty.
Note: If the position is a negative number, then the position is counted from the right.
  • Example: Insert[%bgr%37%%, {1, 2, 3, 4, 5}, -1] places x2 at the end of the list and creates the list {1, 2, 3, 4, 5, 37}.
[Insert[List 1, List 2, Position]: Inserts all elements of list1 in list2 at the given position.           
  • Example: Insert[{11, 12}, {1, 2, 3, 4, 5}, 3] places the elements of list1 at the third (and following) position(s) of list2 and creates the list {1, 2, 11, 12, 3, 4, 5}.
Note: If the position is a negative number, then the position is counted from the right.
  • Example: Insert[{11, 12}, {1, 2, 3, 4, 5}, -2] places the elements of list1 at the end of list2 before its last element and creates the list {1, 2, 3, 4, 11, 12, 5}.

Click and drag the slider a to see how A=Element[list1,a] changes.

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

Related topics:


 Up one level


Page last modified on December 06, 2009, at 12:07 PM