您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > 数学建模之数据处理-03-版
在某海域测得一些点(x,y)处的水深z由下表给出,船的吃水深度为5英尺,在矩形区域(75,200)*(-50,150)里的哪些地方船要避免进入。X129140103.588185.5195105Y7.5141.52314722.5137.585.5Z4868688X157.5107.57781162162117.5Y-6.5-81356.5-66.584-33.5Z9988949(1)输入插值基点数据;(2)在矩形区域(75,200)*(-50,150)作二维三次插值法;(3)做海底曲面图;(4)作出水深小于5的海域范围,即z=5的等高线。解:解答:Matlab程序:x=[129,140,103.5,88,185.5,195,105,157.5,107.5,77,81,162,162,117.5];y=[7.5,141.5,23,147,22.5,137.5,85.5,-6.5,-81,3,56.5,-66.5,84,-33.5];z=[-4,-8,-6,-8,-6,-8,-8,-9,-9,-8,-8,-9,-4,-9];xi=75:10:200;yi=-50:10:150;figure(1)z1i=griddata(x,y,z,xi,yi','nearest');%最邻近插值surfc(xi,yi,z1i)xlabel('X'),ylabel('Y'),zlabel('Z')figure(2)z2i=griddata(x,y,z,xi,yi');%双线性插值surfc(xi,yi,z2i)xlabel('X'),ylabel('Y'),zlabel('Z')figure(3)z3i=griddata(x,y,z,xi,yi','cubic');%双三次插值surfc(xi,yi,z3i)xlabel('X'),ylabel('Y'),zlabel('Z')figure(4)subplot(1,3,1),contour(xi,yi,z1i,4,'b');subplot(1,3,2),contour(xi,yi,z2i,4,'r');subplot(1,3,3),contour(xi,yi,z3i,4,'g');figure(5)%z=5的等高线contour(xi,yi,z3i,7,'r');clabel(z3i,5);画图结果:
本文标题:数学建模之数据处理-03-版
链接地址:https://www.777doc.com/doc-4707052 .html