Fit data to a form other than a simple polynomial

2 ビュー (過去 30 日間)
CGN
CGN 2015 年 10 月 30 日
回答済み: John D'Errico 2015 年 10 月 30 日
I am wondering if it's possible to fit data to fit data to a form than like c1*x^n+c2*x^n-1+...+cn*x+c. Instead, I want to fit data to an equation like c1*x^-3 and so on. How could I do this?

採用された回答

John D'Errico
John D'Errico 2015 年 10 月 30 日
My polyfitn tool (on the file exchange) can do it of course. Or several tools from the curve fitting toolbox, the optimization toolbox, the stats tool box. You can do it trivially using backslash.
n = 100;
x = rand(n,1);
y = rand(n,1);
c = [ones(n,1),x,x.^-1]\y
c =
0.49905
-0.098795
0.0043635

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by