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

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 5 月 29 日
編集済み: Azzi Abdelmalek 2014 年 5 月 29 日

1 投票

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 件)

質問済み:

2014 年 5 月 29 日

コメント済み:

2014 年 5 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by