Mathematics    

Numerical Integration (Quadrature)

The area beneath a section of a function F(x) can be determined by numerically integrating F(x), a process referred to as quadrature. The MATLAB quadrature functions are:

quad
Use adaptive Simpson quadrature
quadl
Use adaptive Lobatto quadrature
dblquad
Numerically evaluate double integral
triplequad
Numerically evaluate triple integral

To integrate the function defined by humps.m from 0 to 1, use

Both quad and quadl operate recursively. If either method detects a possible singularity, it prints a warning.

You can include a fourth argument for quad or quadl that specifies a relative error tolerance for the integration. If a nonzero fifth argument is passed to quad or quadl, the function evaluations are traced.

Two examples illustrate use of these functions:


  Converting Your Optimization Code to MATLAB Version 5 Syntax Example: Computing the Length of a Curve