Curve fitter, how to start?

7 ビュー (過去 30 日間)
Sergio
Sergio 2024 年 2 月 26 日
コメント済み: Star Strider 2024 年 2 月 26 日
Hi, I just imported curve fitter to the my MATLAB. I have these coordinates from the xls file , and I wish to import them directly in curve fitter. But that doesn't open it. Can this be done easily?
Any help appreciated
Thanks

採用された回答

Star Strider
Star Strider 2024 年 2 月 26 日
Try this —
T1 = readtable('data.xlsx');
Var1 = str2double(cellfun(@(x)regexp(x, '\d*', 'match'), T1.Var1));
T1 = removevars(T1,'Var1');
T1 = addvars(T1, Var1, 'Before','Var2')
T1 = 5×2 table
Var1 Var2 ____ ____ 39 167 40 192 41 240 42 343 43 497
fitf1 = fit(T1.Var1, T1.Var2, 'poly1')
fitf1 =
Linear model Poly1: fitf1(x) = p1*x + p2 Coefficients (with 95% confidence bounds): p1 = 81.1 (32.16, 130) p2 = -3037 (-5045, -1030)
figure
plot(fitf1, T1.Var1, T1.Var2)
grid
fitf2 = fit(T1.Var1, T1.Var2, 'poly2')
fitf2 =
Linear model Poly2: fitf2(x) = p1*x^2 + p2*x + p3 Coefficients (with 95% confidence bounds): p1 = 22.36 (14.35, 30.36) p2 = -1752 (-2409, -1096) p3 = 3.45e+04 (2.105e+04, 4.795e+04)
figure
plot(fitf2, T1.Var1, T1.Var2)
grid
.
  2 件のコメント
Sergio
Sergio 2024 年 2 月 26 日
Thanks, the exponential form was the desired! Thanks!
Star Strider
Star Strider 2024 年 2 月 26 日
As always, my pleasure!
Not all the estimated parameters in the exponential or power functions were significantly different from zero (the confidence limits have opposite signs) so I only posted the models with significant parameters. (I tried several different models with 3 or fewer parameters, since there are only 4 data points, only models with 3 or fewer paramters will give reliable results in this instance.)

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by