ooh, for instance - is there a way to constrain the polyfit so that the start and end points are always 0?
Polynomial fitting prob lem
    4 ビュー (過去 30 日間)
  
       古いコメントを表示
    
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')
採用された回答
  Jan
      
      
 2013 年 1 月 28 日
        Searching for already published solutions in the net is a good idea, see:
- http://www.mathworks.com/matlabcentral/fileexchange/38926-fit-polynomial-to-data-with-constraints
- http://www.mathworks.com/matlabcentral/fileexchange/35401-polyfitzero
- http://www.mathworks.com/matlabcentral/fileexchange/220-polyfit2
- http://www.mathworks.com/matlabcentral/fileexchange/272-polyfit0-m/content/polyfit0.m
But interpolating polynomials must oscillate at the edges for high orders. Therefore the order should be chosen as low as possible.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Polynomials についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

