FUNCTION REFERENCE

integral2

Numerical integration over a planar region.

Numerical integration over a planar region.

Syntax

q = integral2(fun, xmin, xmax, ymin, ymax)

Syntax

q = integral2(fun, xmin, xmax, ymin, ymax, 'AbsTol', tol, 'RelTol', tol)

fun(x, y) is called with arrays of the same size and must return an array of that size. xmin and xmax are real scalars; ymin and ymax are real scalars or function handles of x. Any limit may be infinite. Defaults: 'AbsTol' 1e-10, 'RelTol' 1e-6.

Example

integral2(@(x, y) x .* y, 0, 1, 0, 2)   % 1.0000

Example

integral2(@(x, y) x.^2 + y.^2, 0, 1, 0, @(x) x)   % 0.3333

Differences from MATLAB: Always computes iterated one-dimensional integrals; 'Method' is accepted but has no effect. Uses tighter internal tolerances, scales inner absolute tolerances by the outer integration measure, and propagates inner error estimates. The last digits and warnings can differ from MATLAB's tiled method.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.