how to fix a sequence generated using randperm
2 次查看(过去 30 天)
显示 更早的评论
I am trying to generate a sequence of numbers using randperm, is there a way I can fix the sequence generated like for example we can use rng for randi.
0 个评论
采纳的回答
Walter Roberson
2018-6-2
randperm() uses rand() internally, so rng() will work.
3 个评论
Walter Roberson
2018-6-2
>> rng(55)
>> randperm(18,5)
ans =
14 1 4 15 7
>> rng(55)
>> randperm(18,5)
ans =
14 1 4 15 7
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!