## Polynomial evaluation function
## Author: M. Turhan COBAN
## Created: 2021-08-21
## this function calculates the value of polynomial
## a=[a0 a1 a2 a3..]
## f=a0+a1*x+a2*x^2+a3*x^3+.
function retval = poly_func(e,x)
## this function calculates the value of polynomial
## a=[a0 a1 a2 a3..]
## f=a0+a1*x+a2*x^2+a3*x^3+...   
n=length(e);
if n!=0.0
ff=e(n);
for i=n-1:-1:1
ff=ff*x+e(i);
end # for i=n-1:-1:1
else
ff=0.0;
end # n!=0.0
retval= ff;
end
