How to choose 5 random rows from an array of 8 rows for 10 times and save the 10 results
2 ビュー (過去 30 日間)
古いコメントを表示
Hi suppose I have an array of 8 rows as below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275030/image.png)
I wish to choose 5 random rows 10 times
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275031/image.png)
Suppose 6,4,8,7,2 is the first random result, how do I save row 6,4,8,7,2 as a input result so that I do not have a different first result if I wish to run the program next time again. And similarly apply it for the rest of the 9 results.
0 件のコメント
採用された回答
J. Alex Lee
2020 年 3 月 4 日
編集済み: J. Alex Lee
2020 年 3 月 4 日
if order doesn't matter (6,4,8,7,2 is the same as 4,6,8,7,2)
doc nchoosek
if order does matter (6,4,8,7,2 is different from 4,6,8,7,2)
doc perms
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!