Skip to content

integral2

general · scripts/general/integral2.m

  q = integral2 (fun, xmin, xmax, ymin, ymax)
  q = integral2 (..., name, value, ...)
  [q, errbnd] = integral2 (...)
Numerically integrate fun (x, y) over the planar region
xmin <= x <= xmax, ymin(x) <= y <= ymax(x).
fun must accept two equally sized arrays and return an array of
the same size.  xmin and xmax are real scalars (possibly
infinite); ymin and ymax are real scalars or function
handles of x.  Interchanged limits negate the result.
Options (case insensitive names): "AbsTol" (default 1e-10),
"RelTol" (default 1e-6), "Method" ("auto",
"tiled" or "iterated"; all use the same adaptive
algorithm) and "Vectorized" (accepted and ignored).
The integral is evaluated by adaptive tensor-product Gauss-Kronrod
quadrature on the unit square, after mapping the region onto it with
end point smoothing transformations.  errbnd is an estimate of
the absolute error.
See also: integral, integral3, quad2d, dblquad.