Skip to content

quadl

general · scripts/general/quadl.m

: 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, nfev] = quadl (…)

Integrate f over the finite interval from a to b with an adaptive Lobatto rule.

f is a handle, inline function or function name. It is called with a vector of abscissae and must return the corresponding vector of values.

tol is the absolute tolerance, default 1e-6. When trace is true, one line is printed for every subinterval examined: the running count of function evaluations, the left end of the subinterval, its width, and the estimate of the integral over it. Pass [] for either of these to keep its default while giving later arguments.

Any further arguments p1, p2, … are handed on to f after the abscissae.

The second output nfev is the number of times f was called.

The rule is the one described by W. Gander and W. Gautschi in "Adaptive Quadrature - Revisited", BIT 40(1), 2000.