repelem
Repeat copies of array elements
Description
,
where u = repelem(v,n)v is a scalar or vector, returns a vector
of repeated elements of v.
If
nis a scalar, then each element ofvis repeatedntimes. The length ofuislength(v)*n.If
nis a vector, then it must be the same length asv. Each element ofnspecifies the number of times to repeat the corresponding element ofv.
This syntax is not supported for table input.
returns
an array with each element of B = repelem(A,r1,...,rN)A repeated according
to r1,...,rN. Each r1,...,rN must
either be a scalar or a vector with the same length as A in
the corresponding dimension. For example, if A is
a matrix, repelem(A,2,3) returns a matrix containing
a 2-by-3 block of each element
of A.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2015a