Bdiag function

Create block diagonal matrix

Create block diagonal matrix

Bdiag(A, k)

Arguments

  • A: a numeric matrix forming each block.
  • k: an integer value indicating the number of blocks.

Returns

Return a block diagonal matrix from the matrix A.

Examples

Bdiag(matrix(1:4,2,2), 3)