Question: Create Function from Coefficient Vector

So I have a vector X that contains my least squares coefficients. How do I incorporate these coefficients back into a polynomial function automatically using loops or the like? Right now I have to define the funciton manually f:=x-> X[1]*x^3 + X[2]*x^2..... but I want to be able to quickly vary the degree of the polynomial without having to edit the function definition by hand each time. Any geniuses out there that can help me? Thanks, Matt
Please Wait...