repmat {matlab}R Documentation

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.

Author(s)

P. Roebuck, roebuck@mdanderson.org

Examples

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

[Package Contents]