Matlab满足条件矩阵求和,Matlab如何产生满足一定条件的矩阵?谢谢

randint(a,a,p)是产生10行10列随机数是在1-19中的任意数组成的数组

RANDINT Generate matrix of uniformly distributed random integers.

OUT = RANDINT generates a "0" or "1" with equal probability.

OUT = RANDINT(M) generates an M-by-M matrix of random binary numbers.

"0" and "1" occur with equal probability.

OUT = RANDINT(M,N) generates an M-by-N matrix of random binary numbers.

"0" and "1" occur with equal probability.

OUT = RANDINT(M,N,IRANGE) generates an M-by-N matrix of random integers.

IRANGE can be either a scalar or a two-element vector:

Scalar : If IRANGE is a positive integer, then the output integer

range is [0, IRANGE-1].  If IRANGE is a negative integer,

then the output integer range is [IRANGE+1, 0].

Vector : If IRANGE is a two-element vector, then the output

integer range is [IRANGE(1), IRANGE(2)].

OUT = RANDINT(M,N,IRANGE,STATE) causes RAND to use the generator

determined by the 'state' method, and initializes the state of that

generator using the value of STATE.

Examples:

out = randint(2,3)                 out = randint(2,3,4)

out =                              out =

0     0     1                      1     0     3

1     0     1                      2     3     1

out = randint(2,3,-4)              out = randint(2,3,[-2 2])

out =                              out =

-3    -1    -2                     -1     0    -2

-2     0     0                      1     2     1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值