changeset 305:dfa4455033db feature/beams

Made opt more useful.
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 12 Sep 2016 14:08:27 +0200
parents 499653b553b8
children 8368beb0d1b3
files +noname/animate.m
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
diff -r 499653b553b8 -r dfa4455033db +noname/animate.m
--- a/+noname/animate.m	Mon Sep 12 14:08:06 2016 +0200
+++ b/+noname/animate.m	Mon Sep 12 14:08:27 2016 +0200
@@ -5,10 +5,14 @@
 %      noname.animate(discr,1, [tstart tend],'my_mov', opt)
 
 function hand = animate(discretization, time_modifier, Tend, dirname, opt)
-    default_arg('time_modifier',1);
+    default_arg('time_modifier', 1);
     default_arg('Tend', Inf);
-    default_arg('dirname','');
-    default_arg('opt', []);
+    default_arg('dirname', '');
+
+    optDefault.plotType = 'animation';
+    optDefault.time = [];
+
+    default_struct('opt', optDefault);
 
 
     if time_modifier < 0
@@ -34,7 +38,7 @@
     fprintf('m        : %d\n',size(discretization));
 
 
-    ts = discretization.getTimestepper(opt);
+    ts = discretization.getTimestepper(opt.time);
 
     if numel(Tend) == 2
         Tstart = Tend(1);
@@ -50,7 +54,7 @@
         Tstart = start_solution.t;
     end
 
-    [update, figure_handle] = discretization.setupPlot('animation');
+    [update, figure_handle] = discretization.setupPlot(opt.plotType);
     if makemovies
         save_frame = anim.setup_fig_mov(figure_handle,dirname);
     end