注:上机作业文件夹以自己的班级姓名学号命名,文件夹包括如下上机报告和Matlab程序。上机报告模板如下:佛山科学技术学院上机报告课程名称数学应用软件_________________________上机项目___________用MATLAB解插值和曲线拟合问题_____________专业班级________壱.上机目的熟练掌握多种插值方法:线性插值,三次样条插值,三次插值和最近邻点插值(linear、spline.cubicsnearest)Interpl(x,y,ex,'method')在MATLAB的线性最小二乘拟合中,用得较多的是多项式拟合,其命令为:A=polyfit(x,y,m)弐.上机内容1、在飞机的机翼加工时,由于机翼尺寸很大,通常在图纸上只能标出部分关键点的数据.某型号飞机的机翼上缘轮廓线的部分数据如下。用插值法求x每改变0」时的y值,画出图形表示。x04.749.051938577695114133152171190y05.2311.9716.1517」16.3414.63」12」66.697.033.9902、已知观测数据点如表所示:x00.10.20.30.40.50.60.70.80.91丿-0.4471.9783.286.167.087.347.669.569.489.311.2用3次多项式函数拟合这些数据点,画出图形。3^教材习题1,用griddata插值函数,三次插值。4、教材习题4,初始值为V()=0,T=0.05参.上机方法与步骤第1题:要用插值法教每改变0」时的y值,可以选用程序y=interpl(xheng,yzhong,x,'spline1);xheng=[O4.749.051938577695114133152171190];yzhong=[05.238.111.9716.1517.116.3414.6312.166.697.033.990];x=0:0.1:190;y=interpl(xheng,yzhong,x,fsplinef);plot(xheng,yzhong,1+fzx,y,xheng,yzhong,1r:1)xlabel(1xhen1),ylabel(1yzhon1)截图:第2题:要用3次多项式函数拟合这些数据点,并画出图形,选用程序A=polyfit(xzyz3),z=polyval(A,x);plot(x,y,*k+*,xzz,'r*)编程求解即可。x=0:0.1:1;y=[-0.4471.9783.286.167.087.347.669.569.489.311.2];A=polyfit(x,yz3)z=polyval(A,x);plot(x,y,'k+',x,z,*r1)截图:x=0:0.1:1;y=[-0.4471.9783.286.167.087.347.669.569.489.311.2]:A=polyfit(x,y,3)z=polyval(A,x):plot(x,yjk+,,x,z/r')x[sanciduoxiangshi2・mx]第3题:用griddata插值函数,三次插值,选用cK=griddata(T,P,K,cT,cP,*cubic*)编程。T=[68688787106106140140];P=[9.798113.3249.007813.3559.791814.2779.656312.463];K=[0.08480.08970.07620.08070.06960.07530.06110.0651];cT=99;cP=10.3;cK=griddata(TzPzK,cTzcP,*cubic*)截图:增cl1.02-3_4_5一f•••••feyijiyil.mFileEditTextGoCellToolsDebugDesktopWindowHelp%c:t,'Editor・C:\User5\Administrator\Desktop\xishuk3.m-口FileEditTextGoCellToolsDebugDesktopWindowHelp珞■越町色輪旨*41♦♦他|IB■鳞FW□唔:♦回厂回•目b目1.0+-r1.1x恋疫Q1-T=[68688787106106140140];2-P=[9.798113.3249.007813.3559.791814.2779.656312.463];3-K=[0.08480.08970.07620.08070.06960.07530.06110.0651];4一cT=99;5-cP=10.3;6-cK=griddata(T,P,K,cT,cP,cubic7)8第4题:要确定t,v,选用x=lsqcurvefit(12curvefun41,x0zt,v),f=curvefun4(xzt)functionf=curvefun4(x,t)f=10-(10-x(1))*exp(-t/x(2));t=[0.51234579];v=[6.366.487.268.228.668.999.439.63];x0=[0z0.05];x=lsqcurvefit(1curvefun41,xO,t,v)f=curvefun4(x,t)截图:Editor-C:\Users\Administrator\Desktop\curvefun4.m"FileEditTextGoCellToolsDebugDesktopWindowHelpxEditTextCellToolsDesktopWindowHelp>[□曰■僅町e|◎旨兴♦•伦|IH▼档熾屯榕叵▼曙|-IQ+|丰|1・]]芙|囁囁|0t=[0.51234579];Q1^functionf=curvefun4(x^t)2一f=10-(10-x(l))*exp(-t/x(2))::習cl-1.02一v=[6.366.487.268.228.668.999.439.63]:3-x0=[0,0.05]:4—x=lsqcurvefitCcurvefun4?,xO,v)-5一f=curvefun4(x?t)6四.上机结果第1题:截图:QFigure1〔口回丨却J第2题:A=Columns1through316.0758-33.924529.3246Column4-0.6104截图:4MATLAB7.10.0(R2010a)Q自|■股刁O3^^)|®!CurrentFolder:C:\Users\Administrator\Documents\MATLAEShortcutsZJHowtoAdd创What'sNewCurrentFolderxCommandWindowi*NewtoMATLAB?WatchthisVideo,seeDemos,orreadGettingStartsXMAILABdesktopkeyboardshortcuts,suchasCtrl+S?arenowInaddition,manykeyboardshortcutshavechangedfori>proacrossthedesktop・Tocustomizekeyboardshortcuts,usePreferences.FromtherrestorepreviousdefaultfromtheactivesettingssettingsbyselectingR2009afinddrop-doimlist・FormoreinforaatiClickh亡rwifyoudonot・anttoseethismessageagain.Columns1through316.0758-33.924529.3246Column4-0.6104MFigure1■[o[回4耳FileEditViewInsertToolsDesktopWindowHelp0DdHa141爲Q礬®遐XT凰1□目■回第3题:cK=0.0724截图:MATLAB7.10.0(R2010a)第4题:X=5.55773.5002f=Columns1through6.14906.6616Columns6through8.93539.39875截图:7.49138.11478.58329.6604HrMATLAB7.10.0(R2010aT:D已戲|CurrentFolder:CommandWindow?Xi)NewtoMATLAB?WatchthisVideo,seeDemos,orreadGettingStartsXitsinitialvalueislessthanthedefaultvalueofthefi*〈stoppingcrit亡details〉5.55773.5002•♦上«M・・.a>:□1Name▲ShortcutsZJHowtoAddZJWhat'sNewCurrentFolder?XColumns1through56.14906.66167.49138.11478.5832Columns6through8Details8.93539.39879.6604in