random fun.
显示 更早的评论
hi, is there way to chose one no. from two numbers randomly for ex. 2,3 i.e each time chose 2 or 3 randomly
采纳的回答
更多回答(1 个)
Andrew Newell
2012-1-23
randint + 2;
or
randint(m,n) + 2;
for a matrix of random numbers.
or
R = a + randint(m,n)*(b-a);
to choose between any two integers a and b.
类别
在 帮助中心 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!