POLYFIT
Use
polyfit
to fit a 7th-degree polynomial to the points.
Evaluate the polynomial on a finer grid and plot the results.
x = linspace(0,4*pi,10); y = sin(x);
polyfit
to fit a 7th-degree polynomial to the points.p = polyfit(x,y,7);
x1 = linspace(0,4*pi); y1 = polyval(p,x1); figure plot(x,y,'o') hold on plot(x1,y1) hold off
Yorumlar
Yorum Gönder