How to fill the space between two surfaces?
If f1(x,y)≤z≤f2(x,y), how to draw the range of z? If the upper and lower limits of z are described by separate functions, how to plot the range of the z function in the direction of the z-axis instead of two surfaces?
x=-5:0.1:5;
y=-5:0.1:5;
[XX,YY]=meshgrid(x,y);
for m=1:101
for n=1:101
z1(m,n)=x(m)^2+y(n)^2;
z2(m,n)=3*x(m)^3+y(n)^2+1;
plot3([XX(m,n) XX(m,n)],[YY(m,n) YY(m,n)],[z1(m,n) z2(m,n)])
hold on
end
end
hold on
The code to draw only 2 surfaces is given here.
x=-5:0.1:5;
y=-5:0.1:5;
for m=1:101
for n=1:101
z1(m,n)=x(m)^2+y(n)^2;
z2(m,n)=3*x(m)^3+y(n)^2+1;
end
end
surf(x,y,z1,"EdgeColor","none")
hold on
surf(x,y,z2,"EdgeColor","none")If f1(x,y)≤z≤f2(x,y), how to draw the range of z? If the upper and lower limits of z are described by separate functions, how to plot the range of the z function in the direction of the z-axis instead of two surfaces?
x=-5:0.1:5;
y=-5:0.1:5;
[XX,YY]=meshgrid(x,y);
for m=1:101
for n=1:101
z1(m,n)=x(m)^2+y(n)^2;
z2(m,n)=3*x(m)^3+y(n)^2+1;
plot3([XX(m,n) XX(m,n)],[YY(m,n) YY(m,n)],[z1(m,n) z2(m,n)])
hold on
end
end
hold on
The code to draw only 2 surfaces is given here.
x=-5:0.1:5;
y=-5:0.1:5;
for m=1:101
for n=1:101
z1(m,n)=x(m)^2+y(n)^2;
z2(m,n)=3*x(m)^3+y(n)^2+1;
end
end
surf(x,y,z1,"EdgeColor","none")
hold on
surf(x,y,z2,"EdgeColor","none") If f1(x,y)≤z≤f2(x,y), how to draw the range of z? If the upper and lower limits of z are described by separate functions, how to plot the range of the z function in the direction of the z-axis instead of two surfaces?
x=-5:0.1:5;
y=-5:0.1:5;
[XX,YY]=meshgrid(x,y);
for m=1:101
for n=1:101
z1(m,n)=x(m)^2+y(n)^2;
z2(m,n)=3*x(m)^3+y(n)^2+1;
plot3([XX(m,n) XX(m,n)],[YY(m,n) YY(m,n)],[z1(m,n) z2(m,n)])
hold on
end
end
hold on
The code to draw only 2 surfaces is given here.
x=-5:0.1:5;
y=-5:0.1:5;
for m=1:101
for n=1:101
z1(m,n)=x(m)^2+y(n)^2;
z2(m,n)=3*x(m)^3+y(n)^2+1;
end
end
surf(x,y,z1,"EdgeColor","none")
hold on
surf(x,y,z2,"EdgeColor","none") filling surface space, three-dimensional drawing MATLAB Answers — New Questions