《用matlab绘制三维等高线地形图的问题》由会员分享,可在线阅读,更多相关《用matlab绘制三维等高线地形图的问题(2页珍藏版)》请在金锄头文库上搜索。
1、用matlab绘制三维等高线地形图的问题运行程序以后的二维标注等高线怎样把等高线间距缩小?我运行程序以后等高线间隔是200,我想把它调整为100从而反应更细致些该怎么做? 程序如下: %用matlab6 width=1200:400:4000;%x depth=1200:400:3600;%y height=11301250128012301040900500700 13201450142014001300700900850 139015001500140090011001060950 14831200110013501450120011501010 148212001100155016001
2、55019801070 14811550160015501600160016001550 1480150015501510143013001200980;%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,
3、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) %axisofftight; xlabel(Width) ylabel(Depth) zlabel(Heitht) title(带有基准平面的网格图线) %使用三次立方插值法绘制带等高线得表面图 subplot(2,2,4) surfc(wi,di,zcubic) shadingflat%平滑图像 %axisofftight; xlabel(Width) ylabel(Depth) zlabel(Heitht) title(三次立方插值法绘制带等高线得表面图)C,H=contour(wi,di,zcubic,15); 15表示线数!如效果不好,还可以调整!如何在那个二维图上用颜色渐变表示啊?用surf命令 填充表面