# HG changeset patch # User jwe # Date 1194471177 0 # Node ID c0d9ac299176eb00e3d09f5575fead519a3b2a98 # Parent a2174fb073d4dbedc7f2e419cd20e0546c823a5a [project @ 2007-11-07 21:32:57 by jwe] diff -r a2174fb073d4 -r c0d9ac299176 scripts/plot/quiver.m --- a/scripts/plot/quiver.m Wed Nov 07 21:26:43 2007 +0000 +++ b/scripts/plot/quiver.m Wed Nov 07 21:32:57 2007 +0000 @@ -46,17 +46,18 @@ ## The optional return value @var{h} provides a list of handles to the ## the parts of the vector field (body, arrow and marker). ## +## @example ## @group -## @example -## [x,y] = meshgrid(1:2:20); -## quiver(x,y,sin(2*pi*x/10),sin(2*pi*y/10)) +## [x, y] = meshgrid (1:2:20); +## quiver (x, y, sin (2*pi*x/10), sin (2*pi*y/10)); +## @end group ## @end example -## @end group ## ## @seealso{plot} ## @end deftypefn function retval = quiver (varargin) + if (nargin < 2) print_usage (); elseif (isscalar (varargin{1}) && ishandle (varargin{1})) @@ -80,6 +81,7 @@ if (nargout > 0) retval = tmp; endif + endfunction function hlist = __quiver__ (varargin) @@ -89,8 +91,8 @@ arrowsize = 0.33; firstnonnumeric = Inf; - for i = 2 : nargin - if (!isnumeric (varargin {i})) + for i = 2:nargin + if (! isnumeric (varargin {i})) firstnonnumeric = i; break; endif @@ -105,7 +107,7 @@ else iarg = 4; endif - [x, y] = meshgrid (1 : size(u,1), 1 : size(u,2)); + [x, y] = meshgrid (1:size(u,1), 1:size(u,2)); else x = varargin{2}; y = varargin{3}; @@ -211,6 +213,7 @@ end_unwind_protect hlist = [h1; h2; h3]; + endfunction %!demo