Mercurial > repos > public > sbplib
annotate +anim/func.m @ 882:14fee299ada2 feature/poroelastic
In Elastic2dVariable: Improve notation for borrowing constants. Update interface constant to match corrected derivation. Tests ok.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Fri, 26 Oct 2018 16:35:23 -0700 |
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 |