필터 지우기
필터 지우기

Get exact curve parameters in the fit function

조회 수: 7 (최근 30일)
Thorben H
Thorben H 2023년 9월 20일
댓글: Thorben H 2023년 9월 20일
Hi,
I have created and saved a cfit object using the fit() function.
How can I access the exact values of the coefficients? By exact I mean for example coefficients with 10 decimal places.
I am aware that I can access the coefficients using coeffvalues(fitobject) but this only gives the values with 4 decimal places. I am also aware that I can evaluate the fitobject for new data to get the exact result but this is not an option for me, I need the exact coefficient values for the use in an anonymous function.
Any help is appreciated

채택된 답변

the cyclist
the cyclist 2023년 9월 20일
편집: the cyclist 2023년 9월 20일
The four decimal places are just the default display value. You can change that with the format command. For example, use format long before calling coeffvalues(fitobject).
pi
ans = 3.1416
format long
pi
ans =
3.141592653589793
Alternatively, just store the value in a variable, and use the variable in your anonymous function.
  댓글 수: 1
Thorben H
Thorben H 2023년 9월 20일
format... why did I not think of that.. Thanks a lot!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by