How to best randomize Simulink Random Number seeds for Rapid Accelerator simulation
2 次查看(过去 30 天)
显示 更早的评论
I have a large model that I would like to execute iteratively in rapid simulation mode inside a parfor loop. The model contains 112 Random Number or Uniform Random Number blocks spread through various libraries and referenced models. All of them have a seed value of 0. Some of them produce vectors but because the developer (not me) never changed the seed from a scalar 0, the vectors are filled with identical elements.
I would like to randomize the seeds not only within the model (every block a different seed or set of seeds) but for each iteration of my parfor-contained rapid simulation execution.
Is there a straightforward way of accomplishing this?
So far I have tried replacing all of the seeds with randi(intmax,mySize), where mySize is set to match the size of any non-scalar values in Mean, Variance, Minimum, or Maximum. This randomized the outputs between successive runs from the Simulink window, but not if I ran the model successively in rapid accelerator mode with RapidAcceleratorUpToDateCheck off.
I am considering replacing each seed with a reference to a Simulink.Parameter in the base workspace before building the rapid simulation target.
-
The bottom line: I see why random number repeatability is a feature, but I was hoping that there might be a convenient switch to truly randomize my data.
0 个评论
回答(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!