这个matlab怎么画投影图或者是等高线图?程序是 figurefor x1=0:0.05:3 for x2=-2:0.05:0 wp=-0.9375*x1; wp1=0.9375*(2-0.5-2*x1)*(0.5+1)*(x2)^2; plot3(x1,x2,wp1-wp,'m.');hold on endendcontourgrid
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 08:21:30
这个matlab怎么画投影图或者是等高线图?程序是 figurefor x1=0:0.05:3 for x2=-2:0.05:0 wp=-0.9375*x1; wp1=0.9375*(2-0.5-2*x1)*(0.5+1)*(x2)^2; plot3(x1,x2,wp1-wp,'m.');hold on endendcontourgrid
这个matlab怎么画投影图或者是等高线图?
程序是
figure
for x1=0:0.05:3
for x2=-2:0.05:0
wp=-0.9375*x1;
wp1=0.9375*(2-0.5-2*x1)*(0.5+1)*(x2)^2;
plot3(x1,x2,wp1-wp,'m.');hold on
end
end
contour
grid on
xlabel('\beta');ylabel('\wp_2');zlabel('\Re')
这个matlab怎么画投影图或者是等高线图?程序是 figurefor x1=0:0.05:3 for x2=-2:0.05:0 wp=-0.9375*x1; wp1=0.9375*(2-0.5-2*x1)*(0.5+1)*(x2)^2; plot3(x1,x2,wp1-wp,'m.');hold on endendcontourgrid
figure
x1=0:0.05:3;
x2=-3:0.05:0;
for i=1:length(x1)
for j=1:length(x2)
wp=-0.9375*x1(i);
wp1=0.9375*(2-0.5-2*x1(i))*(0.5+1)*(x2(j))^2;
% plot3(x1(i),x2(j),wp1-wp,'m.');hold on
z(i,j) = wp1-wp;
end
end
grid on
xlabel('\beta');ylabel('\wp_2');zlabel('\Re')
figure;
[x,y]=meshgrid(x1,x2);
contour(x,y,z,10);
figure;
surfc(x,y,z);shading interp;