示例1.
[X,Y] = meshgrid(-3:.125:3);
Z = peaks(X,Y);
figure(1); %此句可以省略
subplot(2,1,1);surf(X,Y,Z);
subplot(2,1,2);surfc(X,Y,Z);
axis([-3 3 -3 3 -10 5]);
示例2.
[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
mesh(X,Y,Z)
colorbar
示例3.
[X,Y] = meshgrid(-3:.125:3);
Z = peaks(X,Y);
subplot(3,1,1);mesh(X,Y,Z);
subplot(3,1,2);meshc(X,Y,Z);
subplot(3,1,3);meshz(X,Y,Z);
axis([-3 3 -3 3 -10 5]);