MATLAB: How to integrate over an irregular area in MATLAB 7.9 (R2009b)

MATLABquadquadl

The DBLQUAD function numerically evaluates double integral over a rectangle. I want a function that integrates over an irregular area e.g. within a contour line.

Best Answer

The ability to integrate over an irregular area is not available in MATLAB 7.9 (R2009b).
To work around this issue, use the approach described in the Related Solution.
The idea is to use a rectangular region, but set the function value to zero outside of its domain.