Unrepeated random numbers
1 回表示 (過去 30 日間)
古いコメントを表示
I have a vector S
>> S=[1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10];
I want to randomly pic 5 elements which are unrepeated.
How to do that?
2 件のコメント
Sean de Wolski
2012 年 2 月 13 日
No, I don't think that's what you want. That will always pick the first 5 elements in a new order, the 6th-nth elements will never be selected.
Jonathan Sullivan's solution appears to meet your question's intent.
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!