Write a matlab function whose name is your last name dint2.m to compute the doub
ID: 3581310 • Letter: W
Question
Explanation / Answer
# We get 3 inputs s, t and r. Each will be of (x,y) type.
# To pass the input to integral2 function we have to find
# xmin, xmax and ymin, ymax.
function vol = dint2(f,s,t,r)
# Intialize xmin and xmax arbitarily.
xmin = s(1);
xmax = s(1);
# Comparisons to get exact xmin and xmax.
if xmin > t(1)
xmin = t(1);
end
if xmax < t(1)
xmax = t(1);
end
if xmin > r(1)
xmin = r(1);
end
if xmax < r(1)
xmax = r(1);
end
ymin = s(2);
ymax = s(2);
if ymin > t(2)
ymin = t(2);
end
if ymax < t(2)
ymax = t(2);
end
if ymin > r(2)
ymin = r(2);
end
if ymax < r(2)
ymax = r(2);
end
# Call integral2 function to get the double integral.
vol = integral2(f,xmin,xmax,ymin,ymax);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.