Generating random numbers without repitiion

2 次查看(过去 30 天)
Hello all,
How can I generate, say 10, random numbers uniformly distributed between Nmin and Nmax, without repeating any one of them twice?
Thanks

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2014-5-29
编辑:Azzi Abdelmalek 2014-5-29
Nmin+rand(1,10)*(Nmax-Nmin)
  1 个评论
S. David
S. David 2014-5-29
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 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by