MATLAB Answers

Polyfit Vs Fit command: what are the differences?

28 views (last 30 days)
PRB
PRB on 15 May 2020
Commented: PRB on 26 May 2020
I would like to predict a quadratic curve (y=ax2 + bx + c) from a data set and the relative goodness of the fit model.
I used both the command polyfit (Polynomial curve fitting) and Fit (Fit the curve).
what is the difference between the two methods? Whit the second method I used 'normalize' but when I try to find the value with polyval the predicted data are no correct.
How can I test the goodness of the fit model if I use the command Poltyfit?
Thank you in advance

  0 Comments

Sign in to comment.

Answers (1)

Jyotsna Talluri
Jyotsna Talluri on 25 May 2020
Refer the below link to know the differences betwween fit and polyfit
We cannot determine the goodness of fit using polyfit.Use fit function to determine the goodness of fit.
[fitobject,gof] = fit(x,y,fitType)
returns goodness-of-fit in the structure gof.

Translated by