rand command give different answer
조회 수: 1 (최근 30일)
이전 댓글 표시
![mat.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/270655/mat.jpeg)
why this rand command give different result
댓글 수: 1
Stephen23
2020년 2월 9일
"why this rand command give different result"
What do you expect its output to be?
답변 (2개)
James Tursa
2020년 2월 9일
편집: James Tursa
2020년 2월 9일
rand( ) is a random number generator ... it is supposed to give a different result.
doc rand
If you want to start over with the same stream of numbers you will need to re-seed it.
댓글 수: 1
Chuguang Pan
2020년 2월 9일
All the random number functions, rand, randn, randi, and randperm, draw values from a shared random number generator. Every time you start MATLAB, the generator resets itself to the same state.
The rand function draw values from a RandStream.
댓글 수: 0
참고 항목
카테고리
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!