how to I get the equation of polynomial fit into my code
조회 수: 6 (최근 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!