
分段线性插值函数的编程实现摘要.doc
3页分段线性插值函数的编程实现分段线性插值函数的编程实现摘 要在代数插值过程中,人们为了获得较好的近似效果,通常情况下是增加插值节点数.由于二次插值比线性插值近似效果好,因此容易错误地认为插值多项式次数越高越好.事实上,随着插值节点的增多,插值多项式不一定收敛到被插值函数.通过分段低次插值或样条插值可以得到较好的近似逼近函数,分段低次插值具有公式简单、运算量小、稳定性好、收敛性有保证等优点.随着子区间长度h 取得足够小,分段低次插值总能满足所要求的精度.因此分段低次插值应用十分广泛.分段线性插值是分段低次插值中常见的方法之一,在本文中对在(-5,5)上进行分段线性插值,取不同节点个数,得到不同分段21( )1f xxn线性插值函数.并用 MATLAB 编写分段线性插值函数,最后比较用不同节点数所得插值函数与真实函数的误差,从而得出节点数与插值效果的关系.关键字:线性插值;分段低次插值;分段线性插值函数;MATLAB 软件分段线性插值函数的编程实现USING PROGRAMMING TO ACHIEVE THE PIECEWISE LINEAR INTERPORATION FUNCTIONABSTRACTIn the process of algebra interpolation, people typically increase the interpolation node number in order to get a better approximate result. As the result calculated by quadratic interpolation is better than the same aspect by linear interpolation, it is wrongly thought that the higher power of interpolation the better the result is. In fact, with the increase of the number of node interpolation method, interpolation polynomial is not convergent as interpolation function.It can get much better approximation function through the piecewise low power of interpolation or spline interpolation. Piecewise low power of interpolation is comparably simple and the stability and the convergence can be guaranteed. As the length h of the subinterval approaches to zero, piecewise low power interpolation can meet the required accuracy. This method is used widely.Piecewise linear interpolation is one of the typical methods of piecewise low power of interpolation, in this essay, we will conduct linear interpolation from (-5,5) by different node number n and relative piecewise linear interpolation functions. Then, we will programme linear interpolation by matlab and compare the error between the result derived from linear interpolation and real function. The method is used to test the relationship between different lengths and relative results of interpolation.Key words: linear interpolation; piecewise low power of interpolation; piecewise linear interpolation function; MATLAB software分段线性插值函数的编程实现目 录1 问题的提出........................................................12 理论基础........................................................13 编程过程..........................................................34 结果分析..........................................................75 结论........................................................7参考文献...........................................................8附录...............................................................9。
