rand returns me the same numbers on Simulink?
4 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm making a simulation of how much time is required for an Item to get through some Workstation, and I wanted to give some kind of randomness to worktime, I tried by using a Matlab action service time source, and having a minimum Worktime on which is added the max delay the station can have multiplied for a rand(1) function (as shown below).
However running the simulation multiple times I noticed the value of service time that is returned is always the same, what am I doing wrong? how should I solve it?
Thanks in advance
0 个评论
采纳的回答
Reeshabh Kumar Ranjan
2020-6-23
Hey Teng,
I think this might be the reason of repetition of numbers: https://in.mathworks.com/help/matlab/math/why-do-random-numbers-repeat-after-startup.html
See if it solves your problem.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete-Event Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!