*MERGE

*MERGE, Name1, Name2, Val1, Val2
Merges two dense matrices or vectors into one.

Valid Products: Pro | Premium | Enterprise | PrepPost | Solver | AS add-on

Argument Descriptions

Name1

Name of the matrix or vector to extend.

Name2

Name of the matrix or vector to be merged into Name1.

Val1, Val2

Additional input. The meaning of Val1 and Val2 varies depending on the entity type (matrix or vector). See details below.

The following Val1 and Val2 fields are used if Name1 refers to a dense matrix created by the *DMAT command:

Val1

Column or row number indicating where the new values are to be inserted into the Name1 matrix.

Val2

Specifies how the Name2 matrix or vector is copied into the Name1 matrix.

COL

Insert the new values at the column location specified by Val1 (default).

ROW

Insert the new values at the row location specified by Val1.

The following Val1 field is used if Name1 refers to a vector created by the *VEC command:

Val1

Row number indicating where the new values are to be inserted into the Name1 vector.

Notes

*MERGE can be used to add new columns or rows to a dense matrix that was created by the *DMAT command. In this case, Name1 must be the name of the dense matrix and Name2 must refer to a vector or another dense matrix.

The following two examples demonstrate merging columns into a dense matrix.

The following example demonstrates merging rows into a dense matrix.

*MERGE can also be used to add new rows to a vector that was created by the *VEC command. In this case, Name1 and Name2 must both refer to vectors, as demonstrated in the example below.

In all cases, the values of the original matrix or vector are retained, and the matrix or vector is resized to accommodate the additional rows or columns.

Menu Paths

This command cannot be accessed from a menu.