Mercurial > hg > octave-nkf
diff scripts/plot/quiver.m @ 7121:c0d9ac299176
[project @ 2007-11-07 21:32:57 by jwe]
author | jwe |
---|---|
date | Wed, 07 Nov 2007 21:32:57 +0000 |
parents | a2174fb073d4 |
children | 5eeb46c784d7 |
line wrap: on
line diff
--- a/scripts/plot/quiver.m +++ b/scripts/plot/quiver.m @@ -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