INSERT Function
inserts one matrix inside another
- INSERT( , , row<, column>)
The inputs to the INSERT function are as follows:
- is the target matrix.
It can be either numeric or character.
- is the matrix to be inserted into the target.
It can be either numeric or character,
depending on the type of the target matrix.
- row
- is the row where the insertion is to be made.
- column
- is the column where the insertion is to be made.
The INSERT function returns the result of inserting
the matrix
inside the matrix
at the place
specified by the
row and
column arguments.
This is done by splitting
either horizontally
or vertically before the row or column specified
and concatenating
between the two pieces.
Thus, if
is
rows by
columns,
row can range
from 0 to
and
column can range from 0 to
.
However, it is not possible to insert in both
dimensions simultaneously, so either
row
or
column must be 0, but not both.
The
column argument is optional and defaults to 0.
Also, the matrices must conform in the
dimension in which they are joined.
For example, consider the following statements:
a={1 2, 3 4};
b={5 6, 7 8};
c=insert(a, b, 2, 0);
d=insert(a, b, 0, 3);
These statements produce the following result:
C 4 rows 2 cols (numeric)
1 2
5 6
7 8
3 4
D 2 rows 4 cols (numeric)
1 2 5 6
3 4 7 8
shows the result of insertion in the
middle, while
shows insertion on an end.