How to make elements in an array permanant
Mostrar comentarios más antiguos
I'm creating function that has a random array using randperm. Is there a way to fix the order of the elements in the array even when I run it several times? Every time I use the function, a new array will be produced. I want the function to be so that the randperm will only run once no matter how many times I click 'run'. Thanks
Respuesta aceptada
Más respuestas (1)
James Tursa
el 27 de Mzo. de 2013
0 votos
You could fix the seed used every time so you get the same stream of random numbers with each trial. See the rng function:
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!