Calculate the required area
古いコメントを表示
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 件のコメント
Riccardo Scorretti
2022 年 4 月 30 日
In this way you are computing volumes, not surfaces. The problem is with mathematics, not with MATLAB.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

