cumtrapz
Cumulative trapezoidal numerical integration.
📝Syntax
Z = cumtrapz(Y)
Z = cumtrapz(X, Y)
Z = cumtrapz(Y, dim)
Z = cumtrapz(X, Y, dim)
📥Input Arguments
Parameter Description
Y vector or matrix (real or single)
X point spacing: vector
dim dimension: positive integer scalar
📤Output Arguments
Parameter Description
Z cumulative integral: same size as Y.
📄Description

cumtrapz(Y) computes the cumulative integral of Y using the trapezoidal method with unit spacing, along the first non-singleton dimension.

cumtrapz(X, Y) integrates Y with respect to the coordinates given by X.

The result has the same size as Y, and its first value along the working dimension is 0.

💡Examples
x = 0:0.1:pi;
Z = cumtrapz(x, sin(x))
🔗See Also
trapzcumsum
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub