How to replicate a matlab procedure

2 visualizaciones (últimos 30 días)
Andrew Poissant
Andrew Poissant el 20 de Mzo. de 2017
Respondida: Roger Stafford el 23 de Mzo. de 2017
I currently have a matlab monte carlo simulation that includes multiple for loops. What I want to do is execute the exact same code twice and record a specified value for both of the runs. Is there an easy command or way to do this?
  2 comentarios
James Tursa
James Tursa el 20 de Mzo. de 2017
It isn't clear why you simply can't run the code again. What can't you run the code, record a value, and then run the code again?
Dhruvesh Patel
Dhruvesh Patel el 23 de Mzo. de 2017
Your question seems a bit vague. It would be nice if you could provide a small example scenario which depicts your requirement and even better if it is accompanied by some code.

Iniciar sesión para comentar.

Respuestas (1)

Roger Stafford
Roger Stafford el 23 de Mzo. de 2017
@Andrew. You state that you are doing a Monte Carlo simulation. That is perhaps the reason why you have been unable to duplicate results, since randomness is involved. If that is the trouble, you should use the rng(seed) before each run to duplicate results.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by