Why random number blocks have the same randomness?

5 次查看(过去 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?

采纳的回答

dpb
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...
  1 个评论
israa
israa 2014-9-9
Thanks alot ..I change the RNG to produce unrepeatable random numbers , and its work good

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by