拉格朗日插值法使用MATLAB做的例题精品资料 一物体廓线数据如下:x035791112131415y01.21.72.02.12.01.81.21.01.6用拉格朗日插值法计算x每改变0.5时y的值,即x 取 0.5, 1, 1.5, , 14.5 时对应的y值。程序如下程序运行结果: x=0 3 5 7 9 11 12 13 14 15; y=0 1.2 1.7 2.0 2.1 2.0 1.8 1.2 1.0 1.6; xi=0.5:0.5:14.5; yi=lang(x,y,xi)yi = Columns 1 through 8-15.4117 -15.9238 -10.9898 -5.4272 -1.2253 1.2000 2.1765 2.2666 Columns 9 through 16 1.9894 1.7000 1.5703 1.6249 1.7995 2.0000 2.1477 2.2040 Columns 17 through 24 2.1752 2.1000 2.0269 1.9904 1.9928 2.0000 1.9537 1.8000 Columns 25 through 29 1.5272 1.2000 0.9656 1.0000 1.3480 plot(x,y,b:,xi,yi)运行图:仅供学习与交流,如有侵权请联系网站删除 谢谢3