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!