I want to run a Monte Carlo Simulation on my entire script, How do I do it.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Henn
am 13 Sep. 2017
Kommentiert: Henn
am 14 Sep. 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 Kommentare
Akzeptierte Antwort
Image Analyst
am 13 Sep. 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 Kommentare
Image Analyst
am 14 Sep. 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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!