フィルターのクリア

How can I find the coefficient of my function by using regression in matlab?

3 ビュー (過去 30 日間)
Hi, I really in trouble to find the coefficients of my function as follows: f=A+B(h/D)^n;
f=[6.67836E-05 3.6796E-05 2.30952E-05 1.51082E-05 1.05262E-05 7.56192E-06 5.54116E-06 3.096E-06]; h/D=[0.7696 0.8079 0.8327 0.8523 0.8669 0.8790 0.8892 0.9060];
I need to find the values of coefficients A, B and n by regression, however, I would not be able to do that. any help would be appreciated. Thanks in advance

採用された回答

John D'Errico
John D'Errico 2015 年 3 月 23 日
編集済み: John D'Errico 2015 年 3 月 23 日
Easy enough.
f=[6.67836E-05 3.6796E-05 2.30952E-05 1.51082E-05 1.05262E-05 7.56192E-06 5.54116E-06 3.096E-06];
hd=[0.7696 0.8079 0.8327 0.8523 0.8669 0.8790 0.8892 0.9060];
Using my fminspleas tool, downloaded from the FEX...
funs = {1,@(c,x) x.^c};
[INLP,ILP] = fminspleas(funs,-2,hd,f)
INLP =
-10.064
ILP =
-1.3159e-05
5.7457e-06
n = INLP;
A = ILP(1);
B = ILP(2);
The curve fitting toolbox would do it quite simply too.
  2 件のコメント
Parham Babakhani Dehkordi
Parham Babakhani Dehkordi 2015 年 3 月 23 日
Thank you John for you response,I am beginner in matlab. I wrote the code as follows:
f=[6.67836E-05 3.6796E-05 2.30952E-05 1.51082E-05 1.05262E-05 7.56192E-06 5.54116E-06 3.096E-06]; hd=[0.7696 0.8079 0.8327 0.8523 0.8669 0.8790 0.8892 0.9060]; funs = {1,@(c,x) x.^c}; [INLP,ILP] = fminspleas(funs,-2,hd,f) n = INLP; A = ILP(1); B = ILP(2);
However, there is an error to run the command, 'Undefined function 'fminspleas' for input arguments of type 'cell'.
Error in b (line 4) [INLP,ILP] = fminspleas(funs,-2,hd,f)
John D'Errico
John D'Errico 2015 年 3 月 23 日
I'm quite confident that I told you that you need to download it from the file exchange. Given that I'm looking at my response now as I type this, I can be seriously confident of that fact. In fact, I even gave you a link to do that.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by