Skip to content

integral

general · scripts/general/integral.m

: q = integral (fun, a, b)
: q = integral (fun, a, b, name, value, …)

Numerically integrate the function fun from a to b.

fun is called with a vector of sample points and must return an array of the same size. The limits may be infinite; complex limits define a straight path in the complex plane. The name-value options are "AbsTol" (default 1e-10), "RelTol" (default 1e-6), "ArrayValued" (call fun with scalars so that it may return arrays) and "Waypoints" (points that split the interval or bend the complex path).