Polynomial fitting prob lem

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 件のコメント

Tom
Tom 2013 年 1 月 28 日
ooh, for instance - is there a way to constrain the polyfit so that the start and end points are always 0?

サインインしてコメントする。

 採用された回答

Jan
Jan 2013 年 1 月 28 日

0 投票

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangePolynomials についてさらに検索

タグ

質問済み:

Tom
2013 年 1 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by