Randperm same sequence each time you run the code
6 次查看(过去 30 天)
显示 更早的评论
Is there a possibility to have each time the same random permutation when you run the code to make results comparable?
randperm(length(X))
I want to have the random numbers in the same order everytime the code is run.
0 个评论
采纳的回答
Ameer Hamza
2018-5-26
编辑:Ameer Hamza
2018-5-26
See the random number generator with the same number. For example, add this line before running randperm()
rng(5); % you can use any number instead of 5
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!