Mathematica > Parts of Expressions >

Insert

Insert[list, elem, n]
inserts elem at position n in list. If n is negative, the position is counted from the end.
Insert[expr, elem, {i, j, ...}]
inserts elem at position {i, j, ...} in expr.
Insert[expr, elem, {{i1, j1, ...}, {i2, j2, ...}, ...}]
inserts elem at several positions.
  • list can have any head, not necessarily List.
  • Insert works on SparseArray objects by effectively inserting into the corresponding ordinary lists.
New in 1
© 2008 Wolfram Research, Inc. japanese.gif
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team