how to fix a sequence generated using randperm
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Foram Sanghavi
am 2 Jun. 2018
Kommentiert: Foram Sanghavi
am 2 Jun. 2018
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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 2 Jun. 2018
randperm() uses rand() internally, so rng() will work.
3 Kommentare
Walter Roberson
am 2 Jun. 2018
>> rng(55)
>> randperm(18,5)
ans =
14 1 4 15 7
>> rng(55)
>> randperm(18,5)
ans =
14 1 4 15 7
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!