function y=horner(x,a) n=length(a)-1; y=a(n+1)*(0*x+1); for i=0:n-1 y=y.*x + a(n-i); end end