Skip to content

quad2d

general · scripts/general/quad2d.m

: q = quad2d (fun, xa, xb, ya, yb)
: [q, err] = quad2d (…, name, value, …)

Integrate fun(x, y) over the region xa <= x <= xb, ya <= y <= yb.

fun must accept two arrays of equal size and return an array of that size. The limits ya and yb are either scalars or function handles of x; xa and xb are scalars and may be infinite. The options are "AbsTol" (default 1e-10), "RelTol" (default 1e-6), "MaxFunEvals", "Singular" and "FailurePlot". The second output is an estimate of the absolute error.