Polynomial Curve Fitting Function

Hi, I have some problem regarding the polynomial curve fitting. I compute coefficient from Data A using fifth degree polynomial and the sample coefficient obtained from Data A was used back to Data B (to reconstruct similar to Data A). My question is did the polynomial considered my Data B also to fit the curve ?

답변 (1개)

KSSV
KSSV 2016년 11월 15일

0 개 추천

No it will not consider data B. It gives polynomial coefficients based on Data A. If your data B x ranges are same as data A x ranges, then data B can be fitted with this polynomial.

댓글 수: 9

farah
farah 2016년 11월 16일
Ya Data A and B are in same ranges. So the curve fitting didn't considered my Data B? How about the goodness of fit is it consider the Data B?
KSSV
KSSV 2016년 11월 16일
As the x range's of both the data's are same. Using the coefficients, it will find the respective y values. Fit will be good.
farah
farah 2016년 11월 19일
I understand. So the fit will be good. Actually my project is to reconstruct the Data B to be exactly like Data A. But then I don't know how to conclude that since the curve fitting doesn't consider my data B. Do you have any idea?
KSSV
KSSV 2016년 11월 19일
Attach your data...this is not a tough job..
farah
farah 2016년 11월 23일
Hi, KSSV I have email you my data. Can you check it for me? I don't know how to conclude that.
farah
farah 2016년 11월 23일
If let say I have 4 sample cycle of sine wave. can polynomial work for this wave?
Walter Roberson
Walter Roberson 2016년 11월 23일
sine wave requires infinite degree polynomial to fit.
A fifth degree polynomial has at most 5 real-valued zero crossings. 4 cycles of a sine wave has crossings at 0, Pi, 2*Pi, 3*Pi, 4*Pi, 5*Pi, 6*Pi, 7*Pi, and ends one sample before 8*Pi, which is 8 crossings. Therefore a fifth degree polynomial would have to show very noticeable differences than 4 full cycles of sine.
farah
farah 2016년 11월 24일
so how to to compute that sine wave?
x = linspace(0, 4*2*pi, 501);
x(end) = []; %4 cycles would not touch 0 a fifth time
S4 = sin(x);

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

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

태그

질문:

2016년 11월 15일

댓글:

2016년 11월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by