Calculate the required area
Show older comments
I would like to paint a building (all 5 surfaces) that has 4 vertical straight walls, the upper surface (roof) is described by the function z = g (x, y) for (x, y) ∈ [0.0,4.40] × [0.0, 4.20]. The lower edge of the building is at a height of z (x, y) ≡0. Calculate the required area.
This is the area I would like to calculate

I tried to calculate like this but it does not get me the right answer. Any help?
g = @(x, y) 1./((2+1.1.*x.^2+1.1.*y.^2).^(1/2));
a=0.0;
b=4.40;
c=0.0;
d=4.20;
s1= 1./((2+1.1.*(0.0).^2+1.1.*(0.0).^2).^(1/2));
s2= 1./((2+1.1.*(4.40).^2+1.1.*(4.20).^2).^(1/2));
s3= 1./((2+1.1.*(0.0).^2+1.1.*(4.20).^2).^(1/2));
s4= 1./((2+1.1.*(4.40).^2+1.1.*(0.0).^2).^(1/2));
roof = integral2(g,a,b,c,d);
wall1 = integral2(g,a,b,0,s1);
wall2 = integral2(g,a,b,0,s2);
wall3 = integral2(g,c,d,0,s3);
wall4 = integral2(g,c,d,0,s4);
area = roof + wall1 + wall2 + wall3 + wall4;
1 Comment
Riccardo Scorretti
on 30 Apr 2022
In this way you are computing volumes, not surfaces. The problem is with mathematics, not with MATLAB.
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
