필터 지우기
필터 지우기

What is the difference between polyfit and curve fitting

조회 수: 29 (최근 30일)
Masoud Ghanbari
Masoud Ghanbari 2013년 3월 20일
댓글: Armani 2024년 1월 8일
Hi
What is the difference between polyfit and curve fitting ?
would you please see this page explain me these command:
modelFun = @(p,x) p(3) .* (x ./ p(1)).^(p(2)-1) .* exp(-(x ./ p(1)).^p(2));
startingVals = [10 2 5];
coefEsts = nlinfit(time, conc, modelFun, startingVals);
xgrid = linspace(0,20,100);
line(xgrid, modelFun(coefEsts, xgrid), 'Color','r');
And The Page Is:

채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 3월 21일
I would encourage you to look at the documentation page of the functions you are you using to get a better idea of what each function is suited for.
POLYFIT:
As Matt J mentioned is used to fit polynomials
NLINFIT:
Is non linear fitting/regression for models that need not be polynomials, but can be. Go through the examples in the above links to get a better idea.
  댓글 수: 3
Matt J
Matt J 2013년 3월 22일
편집: Matt J 2013년 3월 22일
You need to decide first what kind of function gives a good model for your (x,y) data. If the (x,y) data come from a polynomial, use POLYFIT. If they come from a more complicated function, use NLINFIT.
Masoud Ghanbari
Masoud Ghanbari 2013년 3월 28일
Thanks Dear Matt J

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

추가 답변 (1개)

Matt J
Matt J 2013년 3월 20일
POLYFIT applies to polynomial fitting only.
  댓글 수: 1
Armani
Armani 2024년 1월 8일
That's correct! POLYFIT is a function specifically designed for fitting polynomial curves to data.
POLYFIT returns the coefficients of the fitted polynomial. These coefficients can be used to create the equation of the polynomial curve, getaway shootout can then be used for various purposes such as prediction, interpolation, or smoothing.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by