Randperm same sequence each time you run the code
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Ameer Hamza
le 26 Mai 2018
Modifié(e) : Ameer Hamza
le 26 Mai 2018
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Random Number Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!