Numerical integration using trapezoidal method.
trapz (y)computes the integral of the y along the first non singleton dimension. If the argument x is omitted a equally spaced vector is assumed.trapz (x,y)evaluates the integral with respect to x.See also: cumtrapz