Inserts values into a series as specified by explicit indices.
INSERT(series, values, idxseries, insertflag)
series |
- |
A series, the series to insert into. |
||||
values |
- |
A series, the values to insert. |
||||
idxseries |
- |
A series of integers. Specifies the indices of the original series of where to insert the new values. |
||||
insertflag |
- |
Optional. An integer specifying how to insert the new values:
|
A series or table.
W1: 1..5
W2: insert(W1, {10, 11, 12}, {1, 3, 5})
W2 contains the series {10, 1, 2, 11, 3, 4, 12, 5}.
W3: insert(W1, {10, 11, 12}, {1, 3, 5}, 1)
W3 contains the series {1, 10, 2, 3, 11, 4, 5, 12}.
insert(1..5, 10..12, {2})
Returns the series {1, 10, 11, 12, 2, 3, 4, 5}.
As indicated by the last example, if there are fewer insertion indices than values to insert, the last insertion index is used.
If an index is larger than the number of points, INSERT pads the intervening values with zeros.