Navigation

Operators and Keywords

Function List:

C++ API

: q = cumtrapz (y)
: q = cumtrapz (x, y)
: q = cumtrapz (…, dim)

Cumulative numerical integration of points y using the trapezoidal method.

cumtrapz (y) computes the cumulative integral of y along the first non-singleton dimension. Where trapz reports only the overall integral sum, cumtrapz reports the current partial sum value at each point of y.

When the argument x is omitted an equally spaced x vector with unit spacing (1) is assumed. cumtrapz (x, y) evaluates the integral with respect to the spacing in x and the values in y. This is useful if the points in y have been sampled unevenly.

If the optional dim argument is given, operate along this dimension.

Application Note: If 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).

See also: trapz, cumsum.

Package: octave