The function "regress" will do a least square polynomial fit. If you use only three points, a second order ploynomial will fit those three points but may not approximate the curve correctly. Build vectors of many points, use regress, and plot the errors to choose the correct order of the polynomial.
↧