shuffle numbers in a vector
594 次查看(过去 30 天)
显示 更早的评论
Hi, I have a vector which has n by 1 entries. I want to randomly shuffle the numbers in this vector! Thanks in advance for any sugestions regarding that!
0 个评论
采纳的回答
Walter Roberson
2011-11-9
YourVector(randperm(length(YourVector))
5 个评论
Sakib Mahmud
2023-1-11
编辑:Sakib Mahmud
2023-1-11
YourVector = YourVector(randperm(length(YourVector)));
更多回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!