For copying matrices as in Matlab (works for sparse matrices)

repMat(X, m, n)

Arguments

X

matrix to replicate

m

number of times replicate the matrix rows

n

number of times replicate the matrix columns