How to generate k unique random numbers from 1 to n in matlab 2009
显示 更早的评论
Hi, I knew randperm(n,k) works but this is after 2011. Can some one tell me if there is any efficient way to do it in matlab 2009.
Thanks
采纳的回答
更多回答(2 个)
Jan
2013-4-27
0 个投票
Not biased and faster than sorting a RAND vector: http://www.mathworks.com/matlabcentral/fileexchange/27076-shuffle
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!