Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Elementary Functions > Matrix generation > repmat

repmat

Replicate and tile an array

Syntax

B = repmat(A, siz)
B = repmat(A, m)
B = repmat(A, m, n,...)

Arguments

A

input 2D array.

m, n, ...

integers, number of A blocks for each dimension of B.

siz

vector of integer, each element gives the number of A blocks for corresponding dimension of B.

B

resulting array form by tiling the A 2D array.

Description

repmat(A,m,n) or similarly repmat(A,[m,n]) returns a large matrix consisting of an m-by-n tiling of copies of A. The size of the result is [size(A,1)*M, size(A,2)*N].

repmat(A,m) creates an m-by-m tiling.

repmat(A,[m n p ...]) tiles the array A to produce a multidimensional array composed of copies of A. The size of the result is [size(A,1)*M, size(A,2)*N, size(A,3)*P, ...].

For now,only arrays of real, integer, boolean, character string, polynomial and rational as well as sparse matrices are supported. This function definition can be extended using overloading mechanism.

Examples

repmat(1:3,2,2)
repmat(int8([1 0 1;0 1 0]),2,3,2)
repmat("Scilab",3,2)
t="Scilab";t(ones(3,2))
repmat([1/%s;2/(%s+1)],1,3)

See also

  • matrix — reshapes an array with the same number and order of components
  • extraction — matrix and list entry extraction
  • size — size of objects

History

VersionDescription
5.3.1 Function repmat introduced.
Report an issue
<< ones Matrix generation squarewave >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:49:19 CET 2020