%% Evaluate Double Integral of Parameterized Function with Specific Method and Error Tolerance
% Create the anonymous parameterized function f(x,y) = ax^{2} + by^{2} with parameters a=3 and b=5.

a = 3; 
b = 5;
fun = @(x,y) a*x.^2 + b*y.^2;

%
% Evaluate the integral over the region 0 \le x \le 5 and -5 \le y \le 0. Specify the 'iterated' method and approximately 10 significant digits of accuracy.

format long
q = integral2(fun,0,5,-5,0,'Method','iterated',...
'AbsTol',0,'RelTol',1e-10)

% Copyright 2012 The MathWorks, Inc.