Using MATLAB,calculate the volume of the solid bounded by the surface x=0; y=0; x+y+z=1 and z=0 and visualize the solid.

 採用された回答

DGM
DGM 2021 年 12 月 23 日

0 投票

Rearrange the implicit equation and observe symmetry and intersections to simplify the task.
syms x y
z0 = 0;
z1 = x+y-1;
vol = int(int(abs(z1)/2,x,0,1),y,0,1)
vol = 
hold on; grid on
h1 = fsurf(z0,[0 1 0 1]);
h2 = fsurf(z1,[0 1 0 1]);
set(h1,'facealpha',0.5);
set(h2,'facealpha',1);
view(-26,16)
I'm not going to bother pruning the surfaces or plotting the vertical faces. This should suffice to make the volume understandable. There are also plenty of other examples of plotting piecewise surfaces using standard tools like surf().

その他の回答 (0 件)

カテゴリ

質問済み:

2021 年 12 月 23 日

回答済み:

DGM
2021 年 12 月 23 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by