annotate general/funutils/scanner_add_plotter.m @ 37:beb8a3f4a345
Renamed prefs to options throughout.
author |
samer |
date |
Mon, 28 Jan 2013 10:52:11 +0000 |
parents |
8f4a21082c45 |
children |
|
rev |
line source |
samer@12
|
1 % scanner_add_plotter - Add plotting capabilities to scan function
|
samer@12
|
2 %
|
samer@12
|
3 % scanner_add_plotter ::
|
samer@12
|
4 % (S,X->S) ~'scanning function',
|
samer@12
|
5 % options {
|
samer@12
|
6 % draw :: bool/false ~'enable drawing if true';
|
samer@12
|
7 % pause :: natural/0 ~'pause duration in ms';
|
samer@12
|
8 % drawnow :: bool/true ~'whether or not to call drawnow afterwards'
|
samer@12
|
9 % }
|
samer@12
|
10 % -> (S,X->X) ~'new scanning function'.
|
samer@12
|
11
|
samer@12
|
12 function f1=scanner_add_plotter(f,opts)
|
samer@37
|
13 opts=options('draw',0,varargin{:});
|
samer@12
|
14 if ~opts.draw, f1=f; else ps=pauser(opts); f1=@g; end
|
samer@26
|
15 function y1=g(y,x), y1=f(y,x); opts.plotfn(x,y,y1); ps(); end
|
samer@12
|
16 end
|