Polynomial curve fitting - MATLAB polyfit
www.mathworks.com › help › matlabOpen Live Script. Create a vector of 5 equally spaced points in the interval [0,1], and evaluate at those points. x = linspace (0,1,5); y = 1./ (1+x); Fit a polynomial of degree 4 to the 5 points. In general, for n points, you can fit a polynomial of degree n-1 to exactly pass through the points. p = polyfit (x,y,4); Evaluate the original ...