用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
matlab等高线填充颜 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命令 填充表面
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论