三维绘图命令使用

clc;
clear all;
close all;

x = -pi:0.1:pi;
y = -pi:0.1:pi;
[X,Y] = meshgrid(x,y);
Z = sin(X).^2 + cos(Y).^2;
subplot(2,2,1);
mesh(X,Y,Z);
grid on ;
title('网格图');
subplot(2,2,2);
mesh(X,Y,Z);
view([0,30])
grid on;
title('在方位0度和视角30度处观察');
subplot(2,2,3);
contour(X,Y,Z);
title('二位等高线');
subplot(2,2,4);
contour3(X,Y,Z);
title('三维等高线');

posted on 2015-03-22 16:54  Kermit.Li  阅读(208)  评论(0编辑  收藏  举报

导航