I want to run a Monte Carlo Simulation on my entire script, How do I do it.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Henn
el 13 de Sept. de 2017
Comentada: Henn
el 14 de Sept. de 2017
Hey guys, I have attached my script in this question. I want to be able to simulate my script 1000 times so that I can have a 1000 values for certain variables in my script near the end.
Please note that within my script there is already a simulation at the beginning (i.e. As part of the simulation that I want, each one will have a part that is being simulated 1000 times.)
Thanks in advance for your help.
0 comentarios
Respuesta aceptada
Image Analyst
el 13 de Sept. de 2017
for k = 1 : 1000
Overall_Omega_Model();
end
Change your script into a function if you want to return any values from it so they can be saved by your "Monte Carlo" program. It's not really a Monte Carlo program if it just calls your function 1000 times, unless maybe there is some randomness built into your Overall_Omega_Model script.
7 comentarios
Image Analyst
el 14 de Sept. de 2017
Just return all of the things in the output argument list. To define:
function [unconstrained, omegaopt_1] = Overall_Omega_Model()
Then, to call in your loop:
[unconstrained, omegaopt_1] = Overall_Omega_Model();
then do something with unconstrained and omegaopt_1, like tack them onto an array of values from all iterations, or whatever.
Más respuestas (0)
Ver también
Categorías
Más información sobre Histograms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!