Why random number blocks have the same randomness?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all
I have 10 nodes , each with trigger input. When there is a trigger hit the node will send a message.
The trigger consist of two Random Source blocks with one Relational Operator block ( < operand) as shown in first picture.
The first Random Source block parameters : min number 1 , max number 10
The second Random Source block parameters : min number 1 , max number 5
The problem is that all the 10 nodes have the same trigger input value (as shown in second picture), thats mean all Random Source blocks have the same randomness! Is this problem belongs to MATLAB solver issues?


0 件のコメント
採用された回答
dpb
2014 年 9 月 9 日
From the doc I find the following interesting note--
"To use other algorithms supported by MATLAB in a Simulink model, generate a stream of random numbers in MATLAB, and store the output as a .mat file. Use this .mat file as the random number input for your simulation. For more information, see Creating and Controlling a Random Number Stream. To create multiple independent streams using MATLAB, see Multiple streams."
"Note: Using multiple seeds to generate multiple parallel independent streams for a generator algorithm is not recommended for the mcg16807 algorithm. Instead, use the method described above."
Also, unless you set the seed to the RNG differently, it is documented that the result is repeatable for a given initial seed. I'd presume this is probably the cause of your getting the same generation from each.
NB: I've never seen a Simulink installation; just reading the doc...
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!