poster
2019-12-10, 20:30
例如:
round(7*rand(1,5)) 生成1到7之间的5个数字是否有办法生成5到7之间的5个随机数?还是那个的抽象?
回答:
更普遍:
minInt = 5; maxInt = 7; numInts = 10; r = randi([minInt, maxInt],[1,numInts]) r = 6 7 7 7 6 5 5 5 7 5
更多&回答... (https://stackoverflow.com/questions/2152334)
round(7*rand(1,5)) 生成1到7之间的5个数字是否有办法生成5到7之间的5个随机数?还是那个的抽象?
回答:
更普遍:
minInt = 5; maxInt = 7; numInts = 10; r = randi([minInt, maxInt],[1,numInts]) r = 6 7 7 7 6 5 5 5 7 5
更多&回答... (https://stackoverflow.com/questions/2152334)