필터 지우기
필터 지우기

polyfit vs. fit

조회 수: 15 (최근 30일)
Giles_T_R_Abbbit
Giles_T_R_Abbbit 2016년 4월 11일
답변: Star Strider 2016년 4월 11일
It seems to me that there are 2 methods to programmatically (as opposed interactively using the curve fitting toobox) fit a 5th order polynomial to a set of data:
the first is to use 'polyfit':
p = polyfit(x, y, 5)
alternatively, it is possible to use 'fit':
p_fitobject = fit(x, y, 'poly5')
Why would I use one over the other?

답변 (1개)

Star Strider
Star Strider 2016년 4월 11일
Those of us without the Curve Fitting Toolbox (like me) would of course have to use polyfit. (With the Statistics Toolbox and Optimization Toolbox, I can do all the other curve-fitting I need to do.) The one advantage I see to polyfit is that as I understand it, fit by default scales and centres the variables, whereas in polyfit that’s an option.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by