预览加载中,请您耐心等待几秒...
1/3
2/3
3/3

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

年级、专业09级信息与计算科学姓名学号名单序号 实验时间2011年12月1日Matlab版本 注:实验报告的最后一部分是实验小结与收获 实验报告(5):插值实验(Interpolation) 2011秋数学实验基础 实验报告(5)PageofNUMPAGES3 (1)WriteaMATLABfunctiontoperformtheLagrangianformInterpolation. functiony=eg1_1 x=[46,49,51,52,54,56,57,58,59,60,61,62,63,64,66,67,68,71,72,71]; y=[40,50,55,63,72,70,77,73,90,93,96,88,99,110,113,120,127,137,132,137]; p=polyfit(x,y,3) xi=46:0.5:72; yi=polyval(p,xi) (2)Writeacallbackm-filetocheckthefunctionyouwrite. p= -0.00170.3275-16.9037291.3741 ans= Columns1through15 40505563727077739093968899110113 Columns16through20 120127137132137 Inthefollowingtable (savedinthedatafilenamedInterpolation_Problem1_data.xls),XistheFahrenheit(华氏的)temperature,andYisthenumberoftimesacricket(蟋蟀)chirps(鸣叫)inoneminute. Makeascatterplot(散点图)ofthedata. >>x=[46,49,51,52,54,56,57,58,59,60,61,62,63,64,66,67,68,71,72,71]; >>y=[40,50,55,63,72,70,77,73,90,93,96,88,99,110,113,120,127,137,132,137]; >>plot(x,y,'o') >>grid Interpolatethedatawithsomeloworderpiecewiseinterpolatingpolynomials. >>x=[46,49,51,52,54,56,57,58,59,60,61,62,63,64,66,67,68,71,72,71]; >>y=[40,50,55,63,72,70,77,73,90,93,96,88,99,110,113,120,127,137,132,137]; >>p=polyfit(x,y,3) p= -0.00170.3275-16.9037291.3741 >>xi=46:0.5:72; >>yi=polyval(p,xi); >>plot(x,y,'o',xi,yi,'k') >>grid Fitthedatabyusingan18th-degreepolynomialthatpassingthrough(通过)thedatapointsasanempiricalmodel.Analyzetheappropriatenessofdoingso. ObservationNumberxyObservationNumberxy1464011619624950126288351551363994526314641105547215661136567016671207577717681278587318711379599019721321060932071137>>x=[46,49,51,52,54,56,57,58,59,60,61,62,63,64,66,67,68,71,72,71]; >>y=[40,50,55,63,72,70,77,73,90,93,96,88,99,110,113,120,127,137,132,137]; >>p=polyfit(x,y,18); >>xi=46:0.5:72; >>yi=polyval(p,xi); >>plot(x,y,'o',xi,yi,'k') >>grid 用18阶多项式拟合数据,画出的图像能够使尽量多的点落在图线上,更接近真实数据。 3.(Optional) (1)WriteaMATLABfunctiontoperformtheLagrangianformInterpolationinsymbolicway. (2)Writeacallbackm-filetocheckthefunctionyouwrite. 小结与收获: 这次作业让我进一步