資源描述:
《樣條插值_______作業(yè)》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、東南大學《數(shù)學實驗》報告學號06010314姓名梅杰成績實驗內(nèi)容:計算矩陣特征值、特征向量;AHP方法的建模與實現(xiàn)一實驗?zāi)康膶W習matlab解題以及插值法使用二預(yù)備知識(1)熟悉樣條插值的含義及計算方法(2)熟悉Matlab命令三實驗內(nèi)容與要求已知某平原地區(qū)的一條公路經(jīng)過如下坐標所表示的點。(1)請用樣條插值繪出這條公路。(不考慮公路寬度)X/米03050708090120148170180Y/米80644742486680120121138X/米202212230248268271280290300
2、312Y/米160182200208212210200196188186X/米320340360372382390416430478440Y/米200184188200202240246280296308X/米420380360340320314280240200Y/米334328334346356360392390400(2)對于上表給出的數(shù)據(jù),估計公路長度。用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’)得到樣條插值函數(shù)所插值出來的圖像:(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)而最終得到結(jié)果為:Len=3.0540e+003即該公路大約長3054米。Matlab繪圖: