%Generate 50 points equally spaced along a sine curve in the interval [-5,5].
x = linspace(-5,5,50);
y = 1./(1+x.^2);
%Use polyfit to fit a 14th-degree polynomial to the points.
p = polyfit(x,y,14);
%Evaluate the polynomial on a finer grid and plot the results.
x1 = linspace(-5,5);
y1 = polyval(p,x1);