MATLAB: Find the volume of the region bounded between the planes x + y + 2z = 2 and 2x + 2y + z = 4 in the first octant.

errorMATLABmatlab functionviewsolid

I uploaded viewSolid and viewSolidone before running the program. I do not understand why an error is showing, the program works for other equations but not for this one.

Best Answer

clear
clc
syms x y z
xa=0;
xb=2;
ya=0+0*x;
yb=2-x;
za=(2-x-y)/2;
zb=4-(2*x)-(2*y);
I=int(int(int(1+0*z,z,za,zb),y,ya,yb),x,xa,xb)
viewSolidone(z,za,zb,y,ya,yb,x,xa,xb)
%Try this code, it will work.
Related Question