diff scripts/general/cumtrapz.m @ 12612:16cca721117b stable

doc: Update all documentation for chapter on Numerical Integration * cumtrapz.m, dblquad.m, quadgk.m, quadl.m, quadv.m, trapz.m, triplequad.m, quad.cc, quadcc.cc: Improve docstrings. * Quad-opts.in: Keep code sample together on a single line. * mk-opts.pl: Update quad-options function description * octave.texi: Update order of detailmenu to match order in quad.texi. * quad.txi: Add language about when to use each quad function, add examples of using trapz. * aspell-octave.en.pws: Add new spelling words from quad.texi chapter
author Rik <octave@nomad.inbox5.com>
date Sun, 17 Apr 2011 19:57:07 -0700
parents d0b799dafede
children f96b9b9f141b
line wrap: on
line diff
--- a/scripts/general/cumtrapz.m
+++ b/scripts/general/cumtrapz.m
@@ -17,17 +17,25 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {@var{z} =} cumtrapz (@var{y})
-## @deftypefnx {Function File} {@var{z} =} cumtrapz (@var{x}, @var{y})
-## @deftypefnx {Function File} {@var{z} =} cumtrapz (@dots{}, @var{dim})
+## @deftypefn  {Function File} {@var{q} =} cumtrapz (@var{y})
+## @deftypefnx {Function File} {@var{q} =} cumtrapz (@var{x}, @var{y})
+## @deftypefnx {Function File} {@var{q} =} cumtrapz (@dots{}, @var{dim})
 ##
-## Cumulative numerical integration using trapezoidal method.
-## @code{cumtrapz (@var{y})} computes the cumulative integral of the
-## @var{y} along the first non-singleton dimension.  If the argument
-## @var{x} is omitted an equally spaced vector is assumed.  @code{cumtrapz
-## (@var{x}, @var{y})} evaluates the cumulative integral with respect
-## to @var{x}.
+## Cumulative numerical integration of points @var{y} using the trapezoidal
+## method.
+## @w{@code{cumtrapz (@var{y})}} computes the cumulative integral of @var{y}
+## along the first non-singleton dimension.  Where @code{trapz} reports
+## only the overall integral sum, @code{cumtrapz} reports the current partial
+## sum value at each point of @var{y}.  When the argument @var{x} is omitted
+## an equally spaced @var{x} vector with unit spacing (1) is assumed. 
+## @code{cumtrapz (@var{x}, @var{y})} evaluates the integral with respect to
+## the spacing in @var{x} and the values in @var{y}.  This is useful if the
+## points in @var{y} have been sampled unevenly.  If the optional @var{dim}
+## argument is given, operate along this dimension.
 ##
+## If @var{x} is not specified then unit spacing will be used.  To scale
+## the integral to the correct value you must multiply by the actual spacing
+## value (deltaX).
 ## @seealso{trapz, cumsum}
 ## @end deftypefn