function iy=Horner3(n,a,c,x) % 用Horner方法计算多项式的定积分 % Input: n - 多项式次数 % a - 多项式从低到高系数,长度为(n+1)的向量 % c - 积分常数 % x - 独立变量,求多项式在该点的值 % NUMERICAL METHODS: Matlab Programs % (c) 2007 by Xie Liling % Complementary Software to accompany the textbook: % Information and Computing Science: A Laboratory Course i=zeros(n+2,1); i(n+2)=a(n+1)/(n+1); for k=n+1:-1:2 i(k)=a(k-1)/(k-1)+i(k+1)*x; end i(1)=c+i(2)*x; iy=i(1);