精选优质文档-倾情为你奉上差商表function A=csb(X,Y)n=length(X);A=zeros(n,n+1);A(:,1)=X;A(:,2)=Y;for j=3:n+1 for i=j-1:n A(i,j)=(A(i,j-1)-A(i-1,j-1)./(A(i,1)-A(i-j+2,1); endend牛顿差值function N R=ndcz(X,Y,x,M);n=length(X);A=csb(X,Y);N=A(1,2);a=zeros(n,1);for i=1:n-1; a(i)=1; for j=1:i; a(i)=a(i)*(x-X(j); end N=N+a(i)*A(i+1,i+2);endk=1;for i=1:n; k=k*(x-X(i)/i; k=abs(k);endR=M*k;专心-专注-专业