specified numbers of random permutation of a vector
조회 수: 9 (최근 30일)
이전 댓글 표시
randperm(n) returns a row vector containing a random permutation of the integers from 1 to n inclusive but I need random permutation of the integers from a vector, also I don't need all off them just specified number e.g. 100.
댓글 수: 1
Walter Roberson
2019년 1월 1일
Duplicates https://www.mathworks.com/matlabcentral/answers/437825-how-could-i-find-specified-number-of-permutation-of-a-vector
채택된 답변
추가 답변 (3개)
madhan ravi
2019년 1월 1일
편집: madhan ravi
2019년 1월 1일
Perhaps random indexing like below?
vector(randperm(100)) % 100 a specified number
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!