What is the difference between rnd(s) and rand('state',s)?
조회 수: 15 (최근 30일)
이전 댓글 표시
What is the difference, and why rand('state',sum(100*clock)) is used, and what does it mean exactly?
댓글 수: 2
Shounak Shastri
2018년 2월 28일
편집: Shounak Shastri
2018년 2월 28일
Sorry but I cannot find anything which is named "rnd". Do you mean "rng" ? Also, please tell us the version of matlab you are using.
Matt J
2018년 2월 28일
Also, please close your many open threads by Accept-clicking the helpful answers. It looks like you got no shortage of them and doing so should ensure responsiveness to your questions.
답변 (1개)
Steven Lord
2018년 2월 28일
See the first section on this documentation page for some of the reasons why rand('state', x) is strongly discouraged. If you're using a release prior to the introduction of rng you may need that syntax, but for new code or if you're updating old code you should use rng instead.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!