Polynomial fitting prob lem

2 Ansichten (letzte 30 Tage)
Tom
Tom am 28 Jan. 2013
Hello,
Would anyone have an idea how to prevent these large peaks and troughs occurring at the edges of a polynomial fit?
x = -1:0.005:1;
y = rand(size(x));
polydegree = 15;
coeffs = polyfit(x, y, polydegree);
y = polyval(coeffs,x);
plot(x,y,'k')
  1 Kommentar
Tom
Tom am 28 Jan. 2013
ooh, for instance - is there a way to constrain the polyfit so that the start and end points are always 0?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 28 Jan. 2013

Weitere Antworten (0)

Kategorien

Mehr zu Polynomials finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by