linalg::stackMatrix -- join
matrices vertically
Introductionlinalg::stackMatrix(A, B1 <, B2...>)
returns the matrix formed by joining the matrices A, B1, B2,
... vertically.
Call(s)linalg::stackMatrix(A, B1 <, B2...>)
ParametersA, B1, B2... |
- | matrices of a domain of category Cat::Matrix |
Returnsa matrix of the domain type Dom::Matrix(R), where R is
the component ring of A.
Related
Functions
DetailsB1, B2... 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 columns as the matrix
A.
Example
1We define the matrix:
>> A:= matrix( [[sin(x),x], [-x,cos(x)]] )
+- -+
| sin(x), x |
| |
| -x, cos(x) |
+- -+
and append the 2 x 2 identity matrix to the
lower end of the matrix A:
>> linalg::stackMatrix(A, matrix::identity(2))
+- -+
| sin(x), x |
| |
| -x, cos(x) |
| |
| 1, 0 |
| |
| 0, 1 |
+- -+
Example
2We define a matrix from the ring of 2x2 square matrices:
>> SqMatQ := Dom::SquareMatrix(2,Dom::Rational): A := SqMatQ([[1, 2], [3, 4]])
+- -+
| 1, 2 |
| |
| 3, 4 |
+- -+
Note that the following operation:
>> AA := linalg::stackMatrix(A, A)
+- -+
| 1, 2 |
| |
| 3, 4 |
| |
| 1, 2 |
| |
| 3, 4 |
+- -+
returns a matrix of a different domain type as the input matrix:
>> domtype(AA)
Dom::Matrix(Dom::Rational)