Generating random numbers without repitiion

Hello all,
How can I generate, say 10, random numbers uniformly distributed between Nmin and Nmax, without repeating any one of them twice?
Thanks

 采纳的回答

Nmin+rand(1,10)*(Nmax-Nmin)

1 个评论

It works. I was using unifrnd, and it was giving me the same number more than once. It seems that rand generates more randomness.
Thanks

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File 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