rand returns me the same numbers on Simulink?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Teng Da Wen
il 23 Giu 2020
Commentato: Teng Da Wen
il 23 Giu 2020
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/320875/image.png)
0 Commenti
Risposta accettata
Reeshabh Kumar Ranjan
il 23 Giu 2020
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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Discrete-Event Simulation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!