Combine square matrices to block-diagonal matrix

Builds a block matrix whose diagonals are the square matrices provided. Taken from https://www.r-bloggers.com/block-diagonal-matrices-in-r/

blockMatrixDiagonal(...)

Arguments

...

Square matrices to combine

See also

Examples

m1=matrix(runif(10*10),nrow=10,ncol=10) m2=matrix(runif(5*5),nrow=5,ncol=5) blockMatrix <- blockMatrixDiagonal(m1,m2,m2,m1)