I would like to approximate numerical data by a function:
f = @(a0,xdata) a0(1).*xdata + ... + a0(n) .* xdata.^n
How can I do that, since a for loop does not work in a function? I know there is an internal polynomial function, but since I might want to extend the sum to non-integer exponents, I want to write my own function.