首页 > 编程知识 正文

matlab中数乘以矩阵,matlab中矩阵的乘方运算

时间:2023-05-05 15:24:11 阅读:254116 作者:4668

>> help repmat

REPMAT Replicate and tile an array.

B = repmat(A,M,N) creates a large matrix B consisting of an M-by-N

tiling of copies of A. The size of B is [size(A,1)*M, size(A,2)*N].

The statement repmat(A,N) creates an N-by-N tiling.

B = REPMAT(A,[M N]) accomplishes the same result as repmat(A,M,N).

B = REPMAT(A,[M N P ...]) tiles the array A to produce a

multidimensional array B composed of copies of A. The size of B is

REPMAT(A,M,N) when A is a scalar is commonly used to produce an M-by-N

matrix filled with A's value and having A's CLASS. For certain values,

you may achieve the same results using other functions. Namely,

REPMAT(NAN,M,N)           is the same as   NAN(M,N)

REPMAT(SINGLE(INF),M,N)   is the same as   INF(M,N,'single')

REPMAT(INT8(0),M,N)       is the same as   ZEROS(M,N,'int8')

REPMAT(UINT32(1),M,N)     is the same as   ONES(M,N,'uint32')

REPMAT(EPS,M,N)           is the same as   EPS(ONES(M,N))

Example:

repmat(magic(2), 2, 3)

repmat(uint8(5), 2, 3)

Class support for input A:

float: double, single

See also bsxfun, meshgrid, ones, zeros, nan, inf.

>> A = [1,2,3];

>> A = repmat(A,[3,1])

A =

1     2     3

1     2     3

1     2     3

>> B = [1;2;3];

>> B = repmat(B,[1,3])

B =

1     1     1

2     2     2

3     3     3

​Struts2的逻辑控制标签怎么使用

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。