annotate general/algo/optpause.m @ 4:e44f49929e56

Adding reorganised general toolbox, now in several subdirectories.
author samer
date Sat, 12 Jan 2013 19:21:22 +0000
parents
children 03694e5c8365
rev   line source
samer@4 1 function optpause(opt)
samer@4 2 % optpause - Optionally pause and/or update graphics
samer@4 3 %
samer@4 4 % optpause :: struct {
samer@4 5 % pause :: natural/0 ~'0-nopause, 1-pause, N-timed pause in ms';
samer@4 6 % drawnow :: bool/0 ~'flush graphics before pausing'
samer@4 7 % } => void.
samer@4 8
samer@4 9 ps=getparam(opt,'pause',0);
samer@4 10 dn=getparam(opt,'drawnow',1);
samer@4 11 if ps,
samer@4 12 if ps>=10, pause(ps/1000); else pause; end
samer@4 13 elseif dn, drawnow;
samer@4 14 end