R/repmat.R

Defines functions repmat

Documented in repmat

#' Replicate and tile an array
#'
#' Repeat copies of array (equivalent of the repmat matlab function).
#'
#' @export repmat
#' @param a input array (scalar, vector, matrix).
#' @param n number of time to repeat input array in row and column dimensions.
#' @param m repetition factor.
#' @examples
#' repmat(10,3,2)
repmat <- function(a, n, m) {
  a <- matrix(a, nrow = 1, ncol = length(a))
  matrix(1, n, m) %x% a
}

Try the rwavelet package in your browser

Any scripts or data that you put into this service are public.

rwavelet documentation built on Jan. 13, 2021, 10:38 a.m.