Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

repmat

Replicate Matrix


Description

Replicate and tile matrix.

Usage

repmat(a, n, m = n)

Arguments

a

vector or matrix to be replicated.

n, m

number of times to replicate in each dimension.

Details

repmat(a,m,n) creates a large matrix consisting of an m-by-n tiling of copies of a.

Value

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.

See Also

Examples

repmat(1, 3)                  # same as ones(3)
repmat(1, 3, 3)
repmat(matrix(1:4, 2, 2), 3)

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.