R2010b rng('shuffle') equivalent ?

4 ビュー (過去 30 日間)
Ravi Shankar Palani
Ravi Shankar Palani 2015 年 4 月 22 日
My university's cluster has MATLAB R2010b on a linux platform. So everytime I run a script it starts MATLAB session, runs my code, and closes it. I generate random number inside the code and the result is the same random number everytime. I browsed online and found extensive documentation helping one to achieve reproducibility. But I want the exact opposite. Of course, running the script again and again in the same MATLAB session generates different random nos. But that isn't the solution I'm looking for. I start a new session everytime to run the script.
In short, I'm looking for rng('shuffle') equivalent in R2010b.

採用された回答

Sebastian Castro
Sebastian Castro 2015 年 4 月 22 日
Here it is (Note: You'll see why it changed in future releases, haha):
stream = RandStream('mt19937ar','seed',sum(100*clock));
RandStream.setDefaultStream(stream);
- Sebastian
  1 件のコメント
Ravi Shankar Palani
Ravi Shankar Palani 2015 年 4 月 22 日
Super. Thanks :)

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

その他の回答 (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