up previous next

create a block matrix

BlockMat(LIST of LIST of MAT): MAT

This function creates a block matrix from a LIST of rows of matrices. The following restrictions on the sizes of the matrices apply: in each row of matrices NumRows(M) must be constant, and for all rows of matrices the total number of columns must be the same.

The function BlockMat2x2 has a simpler syntax for a 2x2 block matrix.

/**/  A := RowMat([1,2,3,4]);   B := RowMat([0,0]);
-- /**/ BlockMat(A,B, B,A);  --> !!! ERROR !!! as expected
/**/  BlockMat2x2(A,B, B,A);  // or equivalently
/**/  BlockMat([[A,B], [B,A]]);
 [[1, 2, 3, 4, 0, 0],
  [0, 0, 1, 2, 3, 4]])

See Also