Trapezoidal numerical integration.
Z = TRAPZ(X,Y) computes the integral of Y with respect to X using
trapezoidal integration. X and Y must be vectors of the same length,
or X must be a column vector and Y a matrix with as many rows as X.
TRAPZ computes the integral of each column of Y separately.
The resulting Z is a scalar or a row vector.
Z = TRAPZ(Y) computes the trapezoidal integral of Y assuming unit
spacing between the data points. To compute the integral for
spacing different from one, multiply Z by the spacing increment.
See also SUM , CUMSUM .