specified numbers of random permutation of a vector
17 次查看(过去 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 个评论
另请参阅
类别
在 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!