changeset 21046:8190fe6dc3fd

* data.cc (Fcumsum, Fcumprod): Provide example in docstring.
author John W. Eaton <jwe@octave.org>
date Fri, 08 Jan 2016 11:38:21 -0500
parents 43b498b8c38c
children 09c7536502f9
files libinterp/corefcn/data.cc
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/data.cc	Thu Jan 07 20:56:34 2016 +0100
+++ b/libinterp/corefcn/data.cc	Fri Jan 08 11:38:21 2016 -0500
@@ -1157,6 +1157,17 @@
 Cumulative product of elements along dimension @var{dim}.\n\
 \n\
 If @var{dim} is omitted, it defaults to the first non-singleton dimension.\n\
+For example:\n\
+\n\
+@example\n\
+@group\n\
+cumsum ([1, 2; 3, 4; 5, 6])\n\
+   @result{}  1   2\n\
+       3   8\n\
+      15  48\n\
+@end group\n\
+@end example\n\
+@end example\n\
 @seealso{prod, cumsum}\n\
 @end deftypefn")
 {
@@ -1193,6 +1204,17 @@
 Cumulative sum of elements along dimension @var{dim}.\n\
 \n\
 If @var{dim} is omitted, it defaults to the first non-singleton dimension.\n\
+For example:\n\
+\n\
+@example\n\
+@group\n\
+cumsum ([1, 2; 3, 4; 5, 6])\n\
+   @result{}  1   2\n\
+       4   6\n\
+       9  12\n\
+@end group\n\
+@end example\n\
+@end example\n\
 \n\
 See @code{sum} for an explanation of the optional parameters\n\
 @qcode{\"native\"}, @qcode{\"double\"}, and @qcode{\"extra\"}.\n\