how to I get the equation of polynomial fit into my code
5 ビュー (過去 30 日間)
古いコメントを表示
Hi Guys,
I used the basic fittings in the plot function to add a line of best fit, which MATLAB shows on the graph. I know want to use that equation in my code. Is there a better way than just copying it down as it it a very long equation.
Thanks
Jamie
0 件のコメント
回答 (1 件)
Sulaymon Eshkabilov
2021 年 10 月 26 日
編集済み: Sulaymon Eshkabilov
2021 年 10 月 26 日
Use these icons to export the fit model into workspace as shown in the Screenshot shown here.
Then use the exported fit model (e.g.: called fit) coefficients, e.g.:
x = 0:13;
FModel = fit.coeff;
FM_vals = polyval(FModel, x);
...
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!