i want to do non linear fitting using the function y=ae^(-bt) + C
5 ビュー (過去 30 日間)
古いコメントを表示
I want to fit the non linear data using the function mentioned above. how do i get the values of a,b, & c. I have attached the text file which has my data.
Thank you.
0 件のコメント
回答 (1 件)
Nade Sritanyaratana
2014 年 8 月 4 日
Have you already parsed t and y from the text file?
I would suggest custom nonlinear fitting since it looks like you want to fit an exponential curve with a constant additive term. Here's a doc page about using CFTOOL to do this.
For example, for the function you are using, I would define a fittype like this:
f = fittype( @(a, b, C, t) a*exp(-b*t) + C);
coeffs = fit(t, y, f);
a = coeffs.a;
b = coeffs.b;
C = coeffs.C;
Make sure that t and y are column vectors. Good luck!
2 件のコメント
Nade Sritanyaratana
2014 年 8 月 4 日
What do t and y look like? Can you print the output of both?
You will need to convert t and y to column vectors but the method to do so will depend on how they are currently stored.
参考
カテゴリ
Help Center および File Exchange で Linear and Nonlinear Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!