- summary: Improve animations? --> Improve animation speed
Another solution for the density plots could be not to redraw the complete figures in every time step but to use the handle of a plot and then only update e.g. the 'YData'-property of a plot. That is expected to be especially useful for more complex plots. Also Axis-labels, title, etc. are not overwritten then, which should generally prevent a lot of overhead.
Quoted from https://stackoverflow.com/questions/26727590/animating-plot-with-matlab-octave
Similarly, for the expectation plots: The Matlab command addpoints(an,x,y) adds points defined by x and y to the animated line specified by an. Create an animated line with the animatedline function. To display the updates on the screen, use drawnow
Quoted from https://de.mathworks.com/help/matlab/ref/animatedline.html