Learn R Programming

matlab (version 0.7-6)

repmat: MATLAB repmat function

Description

Replicate and tile a matrix.

Usage

repmat(A, m, n = if (length(m) == 1)m)

Arguments

A
numeric vector or matrix to be tiled
n, m
dimensions for the result

Value

  • Returns matrix with value A tiled to the number of dimensions specified. Defaults to square if second dimension argument n not provided.

Examples

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

Run the code above in your browser using DataLab