フィルターのクリア

How to calculate the area of a fit curve?

1 回表示 (過去 30 日間)
Fc Fc
Fc Fc 2018 年 5 月 1 日
コメント済み: Ameer Hamza 2018 年 5 月 2 日
Hi, I must calculate the area of 4 fit curves.
I wrote:
myfitga1_P1P2graf= fit(eVc.',ckgran.','a1_P1graf*exp(-((x-285)/c1_P1graf)^2)+a1_P2graf*exp(-((x-287.8)/c1_P2graf)^2)','StartPoint',[start_point start_point start_point start_point]);
myfitga1_P1P2P3graf= fit(eVc.',ckgran.','a1_P1graf*exp(-((x-285)/c1_P1graf)^2)+a1_P2graf*exp(-((x-287.8)/c1_P2graf)^2+a1_P3graf*exp(-((x-292.2)/c1_P3)^2))','StartPoint',[start_point start_point start_point start_point start_point start_point]);
syms eVc;
AreaP1P2graf=int(myfitga1_P1P2graf,eVc,emin,emax);
AreaP1P2P3graf=int(myfitga1_P1P2P3graf,eVc,emin,emax);
myfitga1_P1P2= fit(eVc.',ckxfit.','a1_P1*exp(-((x-285)/c1_P1)^2)+a1_P2*exp(-((x-287.8)/c1_P2)^2)','StartPoint',[start_point start_point start_point start_point]);
myfitga1_P1P2P3= fit(eVc.',ckxfit.','a1_P1*exp(-((x-285)/c1_P1)^2)+a1_P2*exp(-((x-287.8)/c1_P2)^2+a1_P3*exp(-((x-292.2)/c1_P3)^2))','StartPoint',[start_point start_point start_point start_point start_point start_point]);
AreaP1P2=int(myfitga1_P1P2,eVc,emin,emax);
AreaP1P2P3=int(myfitga1_P1P2P3,eVc,emin,emax);
but I get this error:
Undefined function 'int' for input arguments of type 'cfit'.
How to fix it? Best regards

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 5 月 1 日
You are getting the error because int object only accept symbolic expressions where fit() function returns a cfit object. To integrate the cfit object, thre is no need to use syms, use curve fittinng toolbox function integrate as follow
AreaP1P2graf = integrate(myfitga1_P1P2graf ,emin, emax);
  2 件のコメント
Fc Fc
Fc Fc 2018 年 5 月 2 日
Thank you! it worked!
Ameer Hamza
Ameer Hamza 2018 年 5 月 2 日
You are welcome.

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

その他の回答 (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