Join matrices horizontally

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


linalg::concatMatrix(A, B1, <B2, …>)


linalg::concatMatrix(A, B1, B2, dots ) returns the matrix formed by joining the matrices A, B1, B2, … horizontally.

The matrices B1, B2, dots are converted into the matrix domain Dom::Matrix(R), where R is the component ring of A.

An error message is raised if one of these conversions fails, or if the matrices do not have the same number of rows as the matrix A.

A short form of linalg::concatMatrix is available through the dot operator ., i.e., instead of linalg::concatMatrix(A, B) one may use the short form A . B.


Example 1

We define the matrix:

A := matrix([[sin(x), x], [-x, cos(x)]])

and append the 2×2 identity matrix to the right of A:

I2 := matrix::identity(2): 
linalg::concatMatrix(A, I2)

The short form for this operation is:

A . I2

Example 2

We define a matrix from the ring of 2×2 square matrices:

SqMatQ := Dom::SquareMatrix(2, Dom::Rational): 
A := SqMatQ([[1, 2], [3, 4]])

Note the following operation:

AA := A . A

returns a matrix of a different domain type as the input matrix:



A, B1, B2, …

Matrices of a domain of category Cat::Matrix

Return Values

Matrix of the domain type Dom::Matrix(R), where R is the component ring of A.

See Also

MuPAD Functions

Was this topic helpful?