up previous next
BlockMat

create a block matrix

Syntax
BlockMat(A:MAT,B:MAT,C:MAT,D:MAT):MAT

Description
This function creates a block matrix. Each entry is a matrix. Given A, B, C, D matrices, then BlockMat(A,B,C,D) returns the matrix
                | A B |
                | C D |
The obvious restrictions on the sizes of the matrices apply: NumRows(A) = NumRows(B) and NumRows(C) = NumRows(D) , and NumCols(A) = NumCols(C) and NumCols(B) = NumCols(D) .

Example
/**/    A := matrix([[1,2,3], [4,5,6]]);
/**/    B := matrix([[1,2], [3,4]]);
/**/    C := matrix([[1,1,1], [2,2,2], [3,3,3]]);
/**/    D := matrix([[4,4], [5,5], [6,6]]);
/**/    BlockMat(A,B, C,D);
matrix( /*QQ*/
 [[1, 2, 3, 1, 2],
  [4, 5, 6, 3, 4],
  [1, 1, 1, 4, 4],
  [2, 2, 2, 5, 5],
  [3, 3, 3, 6, 6]]
 )

See Also