Owning Class: integration
Requires: MathScript RT Module
q = quada(fun, a, b)
q = quada(fun, a, b, tolerance)
[q, fcnt] = quada(fun, a, b, tolerance)
Legacy Name: quad
Uses the adaptive Lobatto quadrature method to evaluate the integral of a function numerically.
| Name | Description |
|---|---|
| fun | Specifies the function whose numerical integral you want to compute. The function you specify must accept and return a real, double-precision scalar. fun is a string. |
| a | Specifies the lower bound of the integral. a is a real, double-precision scalar. |
| b | Specifies the upper bound of the integral. b is a real, double-precision scalar. |
| tolerance | Controls the accuracy of the quadrature integration. A smaller tolerance leads to a more accurate result but more computation time. The default is 1E-6. |
| Name | Description |
|---|---|
| q | Returns the result of the integration. |
| fcnt | Returns the number of times LabVIEW calls fun during the adaptive integration. |
This function is not supported in the LabVIEW Run-Time Engine. Do not use this function in a stand-alone application or shared library.
% The myfun function is defined by:
% function f = myfun(x)
% f = exp(-2*x)
[q, fcnt] = quada( 'myfun', 0, 1, 1e-5 )
q = quada ('sin', 0, 1)