牛顿插值法的原理,在维基百科上不太全面,具体可以参考这篇文章.同样贴出,楼主作为初学者认为好理解的代码. function p=Newton1(x1,y,x2) %p为多项式估计出的插值 syms x n = length(x1); %差商的求法 for i=2:n f1(i,1)=(y(i)-y(i-1))/(x1(i)-x1(i-1)); end for i=2:n for j=i+1:n f1(j,i)=(f1(j,i-1)-f1(j-1,i-1))/(x1(j)-x1(j-i)); en
This time,you are supposed to find A+B where A+B are two polynomials. Input Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N1 aN1 N2 aN2 ... Nk aNK, Where k is the number