matlab问题

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 16:19:41
matlab问题matlab问题matlab问题clearall[x0,y0]=meshgrid(-3:0.1:3,-3:0.1:3);z0=(x0.^2+y0.^2).^0.5;z1=(-x0.^2

matlab问题
matlab问题

matlab问题

clear all
[x0,y0]=meshgrid(-3:0.1:3,-3:0.1:3);
z0=(x0.^2+y0.^2).^0.5;

z1=(-x0.^2-y0.^2+1).^0.5;
z2=(-x0.^2-y0.^2+4).^0.5;


% figure(1)
mesh(x0,y0,-z2)
hold on
mesh(x0,y0,z2)


mesh(x0,y0,z1)
mesh(x0,y0,-z1)


mesh(x0,y0,z0)
mesh(x0,y0,-z0)


hold off
hidden off
xlabel('X'),ylabel('Y'),zlabel('Z');
grid on;