How to choose 5 random rows from an array of 8 rows for 10 times and save the 10 results
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi suppose I have an array of 8 rows as below:
I wish to choose 5 random rows 10 times
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
댓글 수: 2
추가 답변 (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!