repmat: Repeat matrix.

repmatR Documentation

Repeat matrix.

Description

Create a big matrix by tiling given matrix m*n times in a rectangular grid. repmat resembles the matlab function of the same name.

Usage

repmat(x, m, n)

Arguments

x

a matrix

m

number of repetitions in dimension 1 (row multiply factor)

n

number of repetitions in dimension 2 (column multiply factor)

Value

A matrix of size '(m*r) x (n*c)', where 'r' ('c') represent the number of rows (columns) of 'x'.

Author(s)

Tomas Sieger

Examples

x<-matrix(1:6,2)
x
repmat(x,2,3)

tsieger/tsiMisc documentation built on Oct. 10, 2023, 10:24 p.m.