repmat: Rep Mat Function

Description Usage Arguments Value Examples

View source: R/repmat.R

Description

This function takes a matrix X and replicates it n times column-wise and m times row-wise, similarly to repmat in Matlab

Usage

1
repmat(X, m, n)

Arguments

X

a numeric matrix

m

number of row-wise replications

n

number of column-wise replications

Value

numeric matrix with X replicated n-times across and m-times down

Examples

1
2
3
4
set.seed(1)
x = matrix(rnorm(6),2,3)
x
repmat(x,3,2)

GarrettMooney/moonmisc documentation built on Oct. 19, 2019, 7:51 p.m.