Join matrices horizontally
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
linalg::concatMatrix(A
, B_{1}
, <B_{2}, …
>)
linalg::concatMatrix(A, B_{1},
B_{2}, dots )
returns the matrix formed
by joining the matrices A, B_{1}, B_{2},
… horizontally.
The matrices B_{1}, B_{2},
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
.
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
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:
domtype(AA)

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