Excel Vs Matlab Curve Fitting Tool

10 views (last 30 days)
Hello to everyone whoever is reading this post,
I am using a curve fitting tool for bunch of data points and used 1 degree polynomial to test the equation and coefficients that which i also did in excel. The coefficients seem to be differ, I don't understand why, am i missing something here?
Result from the Excel :
Results from Matlab:
As you see the coefficient seems to be differ so much.
As for a tets example :
x variable 1 : 5
x Variable 2 : 10
Looking for = 0.28+5*0.041-10*0.0038 = 0.447 (From Excel)
Looking for = 0.7639+5*0.1439-10*0.001785 = 1.46 ( From Matlab) which is far off then Excel
Thanks
Karki

Accepted Answer

dpb
dpb on 7 May 2019
Read the output from Matlab -- the model has been standardized whereas the Excel model uses raw data. Note the R-sq and adjusted R-sq values are the same -- they both fit the same model identically.
  2 Comments
Steven Lord
Steven Lord on 7 May 2019
To be more explicit:
x = 5;
y = 10;
normalizedX = (x-13.75)./3.431;
normalizedY = (y-24.26)./4.631;
f = 0.7639 + 0.1439*normalizedX - 0.01785*normalizedY
That's in pretty close agreement to the value you received from Microsoft Excel. If you evaluate the fit with your x and y as shown in the "Evaluate the Fit at a Specific Point" section on this documentation page it will use the full double precision values of the normalization factors and the coefficients. The result of that direct evaluation of the fit should agree even more closely with Excel than the indirect evaluation using the rounded normalization factors and coefficients.
Mahesh Karki
Mahesh Karki on 7 May 2019
Thank you Steven for your clear answer. Appreciated so much. :)

Sign in to comment.

More Answers (0)

Categories

Find more on Data Import from MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!