repmat.RdReplicate and tile matrix.
repmat(a, n, m = n)repmat(a,m,n) creates a large matrix consisting of an m-by-n tiling
of copies of a.
Returns matrix with value a replicated to the number of times
in each dimension specified.
Defaults to square if dimension argument resolves to a single value.
repmat(1, 3) # same as ones(3)
#> [,1] [,2] [,3]
#> [1,] 1 1 1
#> [2,] 1 1 1
#> [3,] 1 1 1
repmat(1, 3, 3)
#> [,1] [,2] [,3]
#> [1,] 1 1 1
#> [2,] 1 1 1
#> [3,] 1 1 1
repmat(matrix(1:4, 2, 2), 3)
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 1 3 1 3 1 3
#> [2,] 2 4 2 4 2 4
#> [3,] 1 3 1 3 1 3
#> [4,] 2 4 2 4 2 4
#> [5,] 1 3 1 3 1 3
#> [6,] 2 4 2 4 2 4