Mercurial > repos > public > sbplib
annotate +anim/func.m @ 396:3fdfad20037e feature/SBPinTimeClarity
Remove whitespace.
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Thu, 02 Feb 2017 09:46:22 +0100 |
| parents | 7f54cef985de |
| children |
| rev | line source |
|---|---|
| 0 | 1 % Animates a function F(x,t) for x in lim from t to tend |
| 228 | 2 function func(F, xrange, yrange, T, timeMod) |
| 3 default_arg('timeMod', 1); | |
| 0 | 4 x = linspace(xrange(1),xrange(2), 200); |
| 5 | |
| 6 fig_handle = figure; | |
| 228 | 7 plot_handle = plot(x,F(x,T(1))); |
| 0 | 8 xlim(xrange) |
| 9 ylim(yrange) | |
| 10 axis_handle = gca; | |
| 11 | |
| 12 | |
| 13 function t = G(t) | |
| 14 set(plot_handle,'YData',F(x,t)) | |
| 15 title(axis_handle,sprintf('T=%.3f',t)); | |
| 16 drawnow | |
| 17 end | |
| 18 | |
| 228 | 19 anim.animate(@G, T(1), T(2), timeMod); |
| 0 | 20 end |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 |
