integralInterpolant
R2026bDescription
Use integralInterpolant to evaluate a definite integral with a
variable upper limit.
integralInterpolant returns an object that interpolates the partial sum
of an approximation of and is used to evaluate for values of x between a and
b. You can evaluate the interpolant F at a set of
values, such as [x1 x2 x3], to calculate the interpolated values,
[F(x1) F(x2) F(x3)].
Creation
Syntax
Description
Input Arguments
Name-Value Arguments
Output Arguments
Properties
Examples
Tips
The
integralInterpolantobject attempts to satisfy the following expression, whereqis the computed value of the integral andQis the (unknown) exact value.The absolute and relative tolerances provide a way to balance accuracy and computation time. Usually, the relative tolerance determines the accuracy of the integration. However, ifabs(q - Q) <= max(AbsoluteTolerance,RelativeTolerance*abs(q))
abs(q)is sufficiently small, the absolute tolerance determines the accuracy of the integration. As a best practice, specify both absolute and relative tolerances together.If you specify single-precision limits of integration, or if the integrand returns single-precision results, you might need to specify larger absolute and relative error tolerances.
You can get the partial sums of the interpolated integral by passing the
Subintervalsproperty to the interpolant. For example, this code returns the partial sums of interpolantF, which approximates the definite integral fromLowerLimittoUpperLimit:PartialSums = F(F.Subintervals)
integralInterpolantuses a high-order interpolation method. If you want faster performance but not necessarily better accuracy, you can convert yourintegralInterpolantobject to agriddedInterpolantobject.
Version History
Introduced in R2026b