《山区地貌 文档.docx》由会员分享,可在线阅读,更多相关《山区地貌 文档.docx(4页珍藏版)》请在优知文库上搜索。
1、山区地貌:在某山区测得一些地点的高程如下表:(平面区域1200x4000,1200y3600),试作出该山区的地貌图和等高线图,并对几种插值方法进行比较.X120016002000240028003200360040001200113012501280123010409005007001600132014501420140013007009008502000139015001500140090011001060950240015001200110013501450120011501010280015001200110015501600155013801070320015001550160015
2、50160016001600155036001480150015501510143013001200980解1430 1300 meshc(x,y,z);通过最近邻点插值、双线性插值方法和双三次插值方法的插值效果进行比较.z=11301250128012301040900500700;13201450142014001300700900850;139015001500140090011001060950:15001200110013501450120011501010;15001200110015501600155013801070;150015501600155016001600160015
3、50;14801500155015101200980;MATLAB程序:X=1200:400:4000;y=1200:400:3600;4000最邻近插值xi=1200:4000;yi=12003600;xi,yi=meshgrid(xi,yi);zi=interp2(x,y,z,xi,yi,nearest);meshc(xi,yi,zi)200015001000,:.5OJ-4000-300(J20双线性插值xi=1200:4000;yi=12003600;xi,yi=meshgrid(xi,yi);zi=interp2(x,y,z,xizyilinear,);meshc(xi,yi,zi)16001400.44fl1200、一ro.800.-600、一400JL-40003000200.二10001000图表2最邻近插值.:,./:4/.3000101000双三次插值xi=1200:4000;yi=12003600;xi,yi=meshgrid(xi,yi);zi=interp2(x,y,z,xizyicubic,);meshc(xi/yi,zi)图表4双三次插值