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