Calculate the required area
Afficher commentaires plus anciens
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 commentaire
Riccardo Scorretti
le 30 Avr 2022
In this way you are computing volumes, not surfaces. The problem is with mathematics, not with MATLAB.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Surface and Mesh Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

