To evaluate integrals of the form

MATLAB provides a function dblquad. The calling syntax for dblquad is
I=dblquad (‘fxy-fun’,xmin,xmax,ymin,ymax,tol,@method)
where tol and method are optional input arguments. The optional argument tol specified tolerance (default value is 10-6), as previously discussed for 1-D integration, and method determines a choice that the user makes about the purpose of integration to be used, e.g., quad and quad1. The default method is quad. The user-defined integrand function fxy-fun,must be written that it can accept a vector x and a scalar y while evaluating the integrand.
Example
Let us compute the following integral

It is merely to verify analytically that I=4. Let us see how dblquad execute on this integral.
>> F = Inline ('1-6*x.^2*y^' ); // Create the integrand as Inline function.
>> I = dblquad (F, 0, 2, -1, 1)
I =
4.0000