Can't understand what rng(seed) does.
조회 수: 25 (최근 30일)
이전 댓글 표시
I have come across this command in matlab. rng(seed). I used the help to understand what its means, and I still don't get it. Can anyone help me understand what it does?
rng Control the random number generator used by RAND, RANDI, and RANDN.
rng(SD) seeds the random number generator using the non-negative
integer SD so that RAND, RANDI, and RANDN produce a predictable
sequence of numbers.
THanks.
댓글 수: 0
답변 (1개)
the cyclist
2015년 4월 20일
편집: the cyclist
2015년 4월 20일
This page from stackoverflow may also help.
댓글 수: 2
the cyclist
2015년 4월 20일
Yes. You can think of the pseudorandom numbers from the generator as a long -- very long -- list of numbers that are uncorrelated with each other, and the seed determines where in that list you start.
참고 항목
카테고리
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!