Matlab里同时显示曲面和曲线在平面上的投影问题代码如下:x=linspace(-4,4,400);y=linspace(-4,4,400); [x,y]=meshgrid(x,y);z=0.2*exp(-2*(x).^2-2*y.^2);surf(x,y,z); shading interp;axis equal;hold on;t = 0:0.001:2*pi;x=2*sin(t);y=2*co
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 11:38:33
Matlab里同时显示曲面和曲线在平面上的投影问题代码如下:x=linspace(-4,4,400);y=linspace(-4,4,400); [x,y]=meshgrid(x,y);z=0.2*exp(-2*(x).^2-2*y.^2);surf(x,y,z); shading interp;axis equal;hold on;t = 0:0.001:2*pi;x=2*sin(t);y=2*co
Matlab里同时显示曲面和曲线在平面上的投影问题
代码如下:
x=linspace(-4,4,400);
y=linspace(-4,4,400);
[x,y]=meshgrid(x,y);
z=0.2*exp(-2*(x).^2-2*y.^2);
surf(x,y,z);
shading interp;
axis equal;
hold on;
t = 0:0.001:2*pi;
x=2*sin(t);
y=2*cos(t);
z=t;
plot3(x,y,z,'r')
画出的图我转到xoy平面上,曲线就会被挡住,如何能同时显示这两个图在xoy上的投影呢?
grid on;
Matlab里同时显示曲面和曲线在平面上的投影问题代码如下:x=linspace(-4,4,400);y=linspace(-4,4,400); [x,y]=meshgrid(x,y);z=0.2*exp(-2*(x).^2-2*y.^2);surf(x,y,z); shading interp;axis equal;hold on;t = 0:0.001:2*pi;x=2*sin(t);y=2*co
x=linspace(-4, 4, 400);
y=linspace(-4, 4, 400);
[x,y]=meshgrid(x, y);
z=0.2*exp(-2*(x).^2-2*y.^2);
surf(x, y, z);
shading interp;
axis square
hold on
t = 0:0.001:2*pi;
x=2*sin(t);
y=2*cos(t);
z=t;plot3(x,y,z,'r','linewidth',2)
tools->Rotate 3D
右键菜单->Go to X-Y View
把axis equal 改成axis square