q = quadgk(fun, a, b)
[q, errbnd] = quadgk(fun, a, b)
[...] = quadgk(fun, a, b, name, value)
| Parameter | Description |
|---|---|
| fun | Integrand: function handle. |
| a, b | Integration limits. Finite complex limits are supported through straight-line contour segments. |
| name, value | Options: 'RelTol', 'AbsTol', 'Waypoints', and 'MaxIntervalCount'. |
| Parameter | Description |
|---|---|
| q | Computed integral. |
| errbnd | Approximate absolute error bound. |
quadgk integrates a vectorized scalar integrand using adaptive Gauss-Kronrod quadrature.
Waypoints split the integral into subintervals. Complex waypoints define a piecewise straight contour.
[q, errbnd] = quadgk(@(x) exp(-x.^2), 0, Inf)
q = quadgk(@(z) 1 ./ (2 .* z - 1), 1, 1, 'Waypoints', [1 + 1i, 0 + 1i, 0 - 1i, 1 - 1i])
| Version | Description |
|---|---|
| 2.0.0 | initial version |