フィルターのクリア

Generating random numbers without repitiion

2 ビュー (過去 30 日間)
S. David
S. David 2014 年 5 月 29 日
コメント済み: S. David 2014 年 5 月 29 日
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 件)

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by