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!