how to fix a sequence generated using randperm
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Foram Sanghavi
il 2 Giu 2018
Commentato: Foram Sanghavi
il 2 Giu 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 Commenti
Risposta accettata
Walter Roberson
il 2 Giu 2018
randperm() uses rand() internally, so rng() will work.
3 Commenti
Walter Roberson
il 2 Giu 2018
>> rng(55)
>> randperm(18,5)
ans =
14 1 4 15 7
>> rng(55)
>> randperm(18,5)
ans =
14 1 4 15 7
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Structures in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!