Plot interations of Monte-Carlo simulation
Show older comments
Hi there,
I ran a Monte Carlo simulation and stored all each iteration in a cell of an array called MATRIX
matrix{iteration,1}
Plotting all iterations in separate graphs is straightforward:
for i=1:length(matrix)
figure(i)
spy(matrix{iteration,1},'r*')
end
BUT running 100 iterations or more, that doesnt seem feasible.
Or what I am doing right now is plotting the last iteration via the spy function:
spy(matrix{end,1},'r*')

Nice, but not quite what I would like.
I have two options in my mind:
- run the 100 iterations in one plot successively with a 1 sec delay
- make a gif with the 100 iterations
Any ideas? I am sure this is again just a few lines of code that I am not able to figure out. Thanks in advance for your help. Much appreciated!!!
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!