Repeat copies of array

Syntax and Description

repmat(A,n) returns an array containing n copies of A in the row and column dimensions. The size of B is size(A)*n when A is a matrix.
repmat(A,r1,r2) specifies a list of scalars, r1 and r2, that describes how copies of A are arranged in each dimension. The size of B is size(A).*[r1,r2]. For example, repmat([1 2; 3 4],2,3) returns a 4-by-6 matrix.
repmat(A,r) specifies the repetition scheme with row vector r. For example, repmat(A,[2 3]) returns the same result as repmat(A,2,3).

Back to functions