quadg/quad2dg

Modified versions of the quadg.m and quad2dg.m from the NIT (Numerical Integration Toolbox)
3.7K Downloads
Updated 3 Jan 2005

No License

These functions are modified versions of the quadg.m and quad2dg.m files found in the NIT (Numerical Integration Toolbox)

The code has been vectorized in order to be able to perform fast integration of several integration limits. As before quadg and quad2dg only calculate one and two dimensional integrals, respectively, but you may specify several integration limits in a single call to the functions. It is also possible to integrate directly given functions enclosed in parenthesis

Example: integration from 0 to 2 and from 2 to 4 for x is done in a single call by:

>>quadg('(x.^2)',[0 2],[2 4])

ans=

2.6667 18.6667

similarly integration from 0 to 2 and from 2 to 4 for both x and y is done in a single call by:

quad2dg('(x.^2.*y)',[0 2],[2 4],[0 2],[2 4])

ans=
5.3333 112.0000

The files were tested under Matlab version 5.2.

Both quadg and quad2dg are not dependent on the Numerical Integration Toolbox (NIT) or the distchk function in the Statistics Toolbox anymore.

Cite As

Per A. Brodtkorb (2024). quadg/quad2dg (https://www.mathworks.com/matlabcentral/fileexchange/33-quadg-quad2dg), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Testing Frameworks in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0

Removed the dependency on other toolboxes so that the files are now self contained.