## General polynomial function
## Author: M. Turhan ÇOBAN
## Created: 2021-08-22

function retval = genpoly_func(f,e,x)
    # this function calculates the value of
    # least square curve fitting function
    n=length(e);
    ff=0.0;
    if n!=0.0
        for i=n:-1:1
            ff=ff+e(i)*f(x,i);
        end
    end
    retval =ff;
endfunction
