repmat
Repeat copies of array
描述
例子
Input Arguments
提示
要通过与一个数组形成输入的张量产品来构建块数组,请使用
克朗
. For example, to stack the row vectorA = 1:3
垂直四次,您可以使用b =克朗(A,ones(4,1))
.To create block arrays and perform a binary operation in a single pass, use
bsxfun
. In some cases,bsxfun
提供更简单,更有效的回忆解决方案。例如,添加向量A = 1:5
和b =(1:10)'
要产生10 x 5阵列,请使用bsxfun(@plus,a,b)
instead ofrepmat(A,10,1) + repmat(B,1,5)
.什么时候
A
是a scalar of a certain type, you can use other functions to get the same result asrepmat
.repmatSyntax Equivalent Alternative repmat(Nan,M,N)
NaN(m,n)
repmat(single(inf),m,n)
inf(m,n,'single')
repmat(int8(0),m,n)
zeros(m,n,'int8')
repmat(uint32(1),m,n)
ones(m,n,'uint32')
repmat(EPS,M,N)
eps(ones(m,n))