Navigation

Operators and Keywords

Function List:

C++ API

: q = quadl (f, a, b)
: q = quadl (f, a, b, tol)
: q = quadl (f, a, b, tol, trace)
: q = quadl (f, a, b, tol, trace, p1, p2, …)
: [q, nfun] = quadl (…)

Numerically evaluate the integral of f from a to b using an adaptive Lobatto rule.

f is a function handle, inline function, or string containing the name of the function to evaluate. The function f must be vectorized and return a vector of output values when given a vector of input values.

a and b are the lower and upper limits of integration. Both limits must be finite.

The optional argument tol defines the absolute tolerance with which to perform the integration. The default value is 1e-6.

The algorithm used by quadl involves recursively subdividing the integration interval. If trace is defined then for each subinterval display: (1) the total number of function evaluations, (2) the left end of the subinterval, (3) the length of the subinterval, (4) the approximation of the integral over the subinterval.

Additional arguments p1, etc., are passed directly to the function f. To use default values for tol and trace, one may pass empty matrices ([]).

The result of the integration is returned in q.

The optional output nfun indicates the total number of function evaluations performed.

Reference: W. Gander and W. Gautschi, Adaptive Quadrature - Revisited, BIT Vol. 40, No. 1, March 2000, pp. 84–101. http://www.inf.ethz.ch/personal/gander/

See also: quad, quadv, quadgk, quadcc, trapz, dblquad, triplequad.

Package: octave