0

Is there a way to generate unique random number using rand and randn in Simevents? I need to generate random numbers for entity service time using rand and randn, but it seems like the numbers generated are repeated. I have tried using rng('shuffle') and rng using algorithms (like rng(1,'philox')) by putting the codes in every servers I have. However, the numbers generated are the same. I have also tried this: https://www.mathworks.com/matlabcentral/answers/334395-how-to-create-random-seed-to-have-different-results-at-each-simevents-run Is there a way to generate unique random numbers using rand and randn in Simevents? Thank you.

jk0026
  • 1
  • 1
  • 1
    Random numbers start from the same seed after startup every time by design, see here: https://uk.mathworks.com/help/matlab/math/why-do-random-numbers-repeat-after-startup.html. Running `rng('shuffle');` should avoid this, as documented. Please show a [mcve] if this is not the case, otherwise we cannot see your issue. – Wolfie Jul 27 '22 at 15:55
  • @Wolfie Thank you for your comment! I have tried that but still giving me the same repeating values. – jk0026 Jul 28 '22 at 17:09

0 Answers0