diff src/DLD-FUNCTIONS/find.cc @ 3369:f37ca3017116

[project @ 1999-11-21 16:26:02 by jwe]
author jwe
date Sun, 21 Nov 1999 16:26:08 +0000
parents 38de16594cb4
children ca92c9d3f882
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/find.cc	Sat Nov 20 17:23:01 1999 +0000
+++ b/src/DLD-FUNCTIONS/find.cc	Sun Nov 21 16:26:08 1999 +0000
@@ -157,7 +157,43 @@
 }
 
 DEFUN_DLD (find, args, nargout,
-  "find (X) or [I, J, V] = find (X): Return indices of nonzero elements")
+  "-*- texinfo -*-\n\
+@deftypefn {Loadable Function} {} find (@var{x})\n\
+Return a vector of indices of nonzero elements of a matrix.  To obtain a\n\
+single index for each matrix element, Octave pretends that the columns\n\
+of a matrix form one long vector (like Fortran arrays are stored).  For\n\
+example,\n\
+\n\
+@example\n\
+@group\n\
+find (eye (2))\n\
+     @result{} [ 1; 4 ]\n\
+@end group\n\
+@end example\n\
+\n\
+If two outputs are requested, @code{find} returns the row and column\n\
+indices of nonzero elements of a matrix.  For example,\n\
+\n\
+@example\n\
+@group\n\
+[i, j] = find (2 * eye (2))\n\
+     @result{} i = [ 1; 2 ]\n\
+     @result{} j = [ 1; 2 ]\n\
+@end group\n\
+@end example\n\
+\n\
+If three outputs are requested, @code{find} also returns a vector\n\
+containing the nonzero values.  For example,\n\
+\n\
+@example\n\
+@group\n\
+[i, j, v] = find (3 * eye (2))\n\
+     @result{} i = [ 1; 2 ]\n\
+     @result{} j = [ 1; 2 ]\n\
+     @result{} v = [ 3; 3 ]\n\
+@end group\n\
+@end example\n\
+@end deftypefn")
 {
   octave_value_list retval;