Random Number Generator
2 次查看(过去 30 天)
显示 更早的评论
Hello All,
I have been charged with coming up with a way to raffle an iPad2 at a charity event. The raffle participants are all members of the non-profit with member id#'s. Instead of putting paper in a bowl I thought about using a random number generator to produce the winning member id. I thought that Mat-Lab would be a useful tool for doing this. Any thoughts??
0 个评论
采纳的回答
Paulo Silva
2011-9-1
RandStream.setDefaultStream(RandStream('mt19937ar','seed',sum(100*clock)));
n=10; %number of ids
randi([1 n])
2 个评论
Paulo Silva
2011-9-1
That would do it but it's too much work and I can't think any other way besides getting another set of consecutive IDs for each participant.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!