Does the MATLAB function 'rand()' use hardware seeded RdRand system call available in the main PC processors?

1 回表示 (過去 30 日間)
I could not find any documentation that MATLAB does. This website describes the system call: https://en.wikipedia.org/wiki/RdRand .

採用された回答

Walter Roberson
Walter Roberson 2017 年 6 月 30 日
編集済み: Walter Roberson 2017 年 6 月 30 日
No, it does not.
"rng('default') puts the settings of the random number generator used by rand, randi, and randn to their default values. This way, the same random numbers are produced as if you restarted MATLAB. The default settings are the Mersenne Twister with seed 0."
If you look at the list of supported random number generators there, you will see that they are all deterministic: given the same seed they will repeat exactly.
That leaves only the question of how you can initialize them differently. The key to that is "rng('shuffle') seeds the random number generator based on the current time."
The hardware random instructions are not used at all.
  1 件のコメント
Emmett Redd
Emmett Redd 2017 年 6 月 30 日
Thanks. Sometimes it is good to have a random number generator repeat and sometimes not.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by