Workaround on curvefit limitation

2 ビュー (過去 30 日間)
Sergio
Sergio 2020 年 10 月 27 日
コメント済み: Sergio 2020 年 10 月 27 日
Hello,
Is there any workaround to fit a function using the fit command without the limitation of 8 coefficients (considering the sum of sines or Fourier, specifically)?
Examples: model = fit(x,y,’sin10’) or model2 = (x,y,’fourier11’).
Thanks in advance.

採用された回答

Steven Lord
Steven Lord 2020 年 10 月 27 日
The built-in library of fits only contains sum of sines and Fourier fits up to sin8 and fourier8. If appropriate you could write your own custom fit using the fittype function, but keep in mind the advice from Jeff Goldblum's character in Jurassic Park: "Your scientists were so preoccupied with whether they could that they didn’t stop to think if they should."
Don't fit a sum of 30 sine functions (for example) just because you can, ask yourself if fitting a sum of 30 sine functions is a reasonable thing to do based on the problem you're trying to solve.
  1 件のコメント
Sergio
Sergio 2020 年 10 月 27 日
Dear Steven,
Thanks for the answer and the witty quote :D.
In my case, I really should do this.
Best

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by