Originally Posted by

**matlab** [% Function f(x) is defined by

f(x,y)=x.^2*y-2*x*y+x*y.^2;

% We are integrating this with respect to x and y

% Using the Internd funcition to evaluate this integral

f(x,y) = integrnd(x,y);

f(x,y) = x.^2*y -2*x*y +x*y.^2;

% xmin is the Lower Limit of Inner Integral

% xmax is the Upper Limit of Inner Integral

% ymin is the Lower Limit of Outer Integral

% ymax is the Upper Limit of Outer Integral

xmin = 1;

xmax = 2;

ymin = 0;

ymax = 3;

f(x,y) = dblquad(@integrnd,xmin,xmax,ymin,ymax);

% This is integrating the function with respect to x and y

% To plot in 3d, we must use the plot3d command

plot3(x,y,z)

grid on

title('f(x,y) represented in 3D view')

xlabel('x = cos(a)')

ylabel('y = sin(a)')

zlabel('z = a')