Mercurial > repos > public > sbplib
annotate +anim/func.m @ 1344:b4e5e45bd239 feature/D2_boundary_opt
Remove round off zeros from D2Nonequidistant operators
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sat, 15 Oct 2022 15:48:20 +0200 |
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 |