资源描述:
《样条插值_______作业》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、东南大学《数学实验》报告学号06010314姓名梅杰成绩实验内容:计算矩阵特征值、特征向量;AHP方法的建模与实现一实验目的学习matlab解题以及插值法使用二预备知识(1)熟悉样条插值的含义及计算方法(2)熟悉Matlab命令三实验内容与要求已知某平原地区的一条公路经过如下坐标所表示的点。(1)请用样条插值绘出这条公路。(不考虑公路宽度)X/米03050708090120148170180Y/米80644742486680120121138X/米202212230248268271280290300
2、312Y/米160182200208212210200196188186X/米320340360372382390416430478440Y/米200184188200202240246280296308X/米420380360340320314280240200Y/米334328334346356360392390400(2)对于上表给出的数据,估计公路长度。用MATLAB解题如下:(1)x1=[0,30,50,70,80,90,120,148,170,180,202,212,230,248,268
3、,271,280,290,300,312,320,340,360,372,382,390,416,430,478];y1=[80,64,47,42,48,66,80,120,121,138,160,182,200,208,212,210,200,196,188,186,200,184,188,200,202,240,246,280,296];x2=[440,420,380,360,340,320,314,280,240,200];y2=[308,334,328,334,346,356,360,392,
4、390,400];xx=0:1:478;yy=spline(x1,y1,xx);plot(x1,y1,’o’,xx,yy,’m’)holdonxxx=440:-1:200;yyy=spline(x1,y1,xxx);plot(x2,y2,’o’,xxx,yyy,’m’)得到样条插值函数所插值出来的图像:(2)由于只要估计公路的长度,故直接算两点间连线的长度的总合,命令如下:X=[03050708090120148170180202212230248268271280290300312320340360
5、372382390416430478440420380360340320314280240200];Y=[80644742486680120121138160182200208212210200196188186200184188200202240246280296308334328334346356360392390400];plot(X,Y,'o-')fork=1:length(X)-1len(k)=sqrt((X(k+1)-X(k))^2+(Y(k+1)-X(k))^2);endLen=sum(
6、len)而最终得到结果为:Len=3.0540e+003即该公路大约长3054米。Matlab绘图: