用 matlab 绘制三维等高线地形图的问题
运行程序以后的二维标注等高线怎样把等高线间距缩小?我运行程序以后等高线间隔是
200,我想把它调整为 100 从而反应更细致
程序如下:
%用 matlab6
width=1200:400:4000;%x
depth=1200:400:3600;%y
height=[1130 1250 1280 1230 1040 900 500 700
1320 1450 1420 1400 1300 700 900 850
1390 1500 1500 1400 900 1100 1060 950
1483 1200 1100 1350 1450 1200 1150 1010
1482 1200 1100 1550 1600 1550 1980 1070
1481 1550 1600 1550 1600 1600 1600 1550
1480 1500 1550 1510 1430 1300 1200 980];%z
wi=1200:50:4000;
di=1200:50:3600;
di=di';
zcubic=interp2(width,depth,height,wi,di,'cubic');
subplot(2,2,1)
%在二维上标注等高线
[C,H]=contour(wi,di,zcubic);
clabel(C,H)
xlabel('Width')
ylabel('Depth')
title('在二维上标注等高线')
%在三维上标注等高线
subplot(2,2,2)
[C,H]=contour3(wi,di,zcubic);
clabel(C,H)
xlabel('Width')
ylabel('Depth')
zlabel('Heitht')
title('在三维上标注等高线')
%带有基准平面的网格图
subplot(2,2,3)
meshz(wi,di,zcubic)
%axis off tight;
xlabel('Width')
ylabel('Depth')
zlabel('Heitht')
title('带有基准平面的网格图线')
%使用三次立方插值法绘制带等高线得表面图
subplot(2,2,4)
surfc(wi,di,zcubic)
shading flat%平滑图像
%axis off tight;
xlabel('Width')
ylabel('Depth')
zlabel('Heitht')
title('三次立方插值法绘制带等高线得表面图')
[C,H]=contour(wi,di,zcubic,15);
'15' 表示线数!如效果不好,还可以调整!
用 surf 命令 填充表面