Mercurial > octave-nkf
diff src/DLD-FUNCTIONS/find.cc @ 11553:01f703952eff
Improve docstrings for functions in DLD-FUNCTIONS directory.
Use same variable names in error() strings and in documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 16 Jan 2011 22:13:23 -0800 |
parents | fd0a3ac60b0e |
children | 12df7854fa7c |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/find.cc Sat Jan 15 15:13:06 2011 -0800 +++ b/src/DLD-FUNCTIONS/find.cc Sun Jan 16 22:13:23 2011 -0800 @@ -337,9 +337,11 @@ DEFUN_DLD (find, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} find (@var{x})\n\ -@deftypefnx {Loadable Function} {} find (@var{x}, @var{n})\n\ -@deftypefnx {Loadable Function} {} find (@var{x}, @var{n}, @var{direction})\n\ +@deftypefn {Loadable Function} {@var{idx} =} find (@var{x})\n\ +@deftypefnx {Loadable Function} {@var{idx} =} find (@var{x}, @var{n})\n\ +@deftypefnx {Loadable Function} {@var{idx} =} find (@var{x}, @var{n}, @var{direction})\n\ +@deftypefnx {Loadable Function} {[i, j] =} find (@dots{})\n\ +@deftypefnx {Loadable Function} {[i, j, v]] =} find (@dots{})\n\ Return a vector of indices of nonzero elements of a matrix, as a row if\n\ @var{x} is a row or as a column otherwise. To obtain a single index for\n\ each matrix element, Octave pretends that the columns of a matrix form one\n\ @@ -393,7 +395,7 @@ b = sparse(i, j, v, sz(1), sz(2));\n\ @end group\n\ @end example\n\ -@seealso{sparse}\n\ +@seealso{nonzeros}\n\ @end deftypefn") { octave_value_list retval; @@ -414,7 +416,7 @@ if (error_state || (val < 0 || (! xisinf (val) && val != xround (val)))) { - error ("find: expecting second argument to be a nonnegative integer"); + error ("find: N must be a nonnegative integer"); return retval; } else if (! xisinf (val)) @@ -439,7 +441,7 @@ if (direction == 0) { - error ("find: expecting third argument to be \"first\" or \"last\""); + error ("find: DIRECTION must be \"first\" or \"last\""); return retval; } }