Mercurial > repos > public > sbplib
comparison +noname/animate.m @ 707:0de70ec8bf60 feature/quantumTriangles
merge with feature/optim
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Fri, 10 Nov 2017 14:22:56 +0100 |
parents | 082c7bf3192e |
children | c9147e05d228 |
comparison
equal
deleted
inserted
replaced
696:7c16b5af8d98 | 707:0de70ec8bf60 |
---|---|
1 % hand = noname.animate(discretization, time_modifier, Tend, dirname, opt) | 1 % noname.animate(discretization, time_modifier, Tend, dirname, opt) |
2 % | 2 % |
3 % Example: | 3 % Example: |
4 % noname.animate(discr,timemodifier,tend) | 4 % noname.animate(discr,timemodifier,tend) |
5 % noname.animate(discr,1, [tstart tend],'my_mov', opt) | 5 % noname.animate(discr,1, [tstart tend],'my_mov', opt) |
6 | 6 |
7 function hand = animate(discretization, time_modifier, Tend, dirname, opt) | 7 function animate(discretization, time_modifier, Tend, dirname, opt) |
8 default_arg('time_modifier', 1); | 8 default_arg('time_modifier', 1); |
9 default_arg('Tend', Inf); | 9 default_arg('Tend', Inf); |
10 default_arg('dirname', ''); | 10 default_arg('dirname', ''); |
11 | 11 |
12 optDefault.plotType = 'animation'; | 12 optDefault.plotType = 'animation'; |
85 | 85 |
86 if ~do_step | 86 if ~do_step |
87 pause | 87 pause |
88 anim.animate(@G, Tstart, Tend, time_modifier); | 88 anim.animate(@G, Tstart, Tend, time_modifier); |
89 else | 89 else |
90 while true | 90 pause |
91 while ts.t < Tend | |
91 ts.step(); | 92 ts.step(); |
92 sol = discretization.getTimeSnapshot(ts); | 93 sol = discretization.getTimeSnapshot(ts); |
93 update(sol); | 94 update(sol); |
94 drawnow | 95 drawnow |
95 | 96 |