how to fit a signal using polynomial fit with hogher order?

I have a amplitude value with time period of a signal. I am trying to fit this signal by polynomial fitting. I have attached the amplitude vaueand written the code but it is not fitting. Is it possible to it using higher order of polynomial. I want to fit the curve using higher polynomial order (i.e. greater than 9) but it is not done. Please help me to solve this,
tt=0:2:3601;
tt=tt';
filename = 'value.xlsx';
A = xlsread(filename);
f1=fit(tt,A,'poly9');
plot(f1,tt,A);

4 comentarios

KSSV
KSSV el 30 de Sept. de 2020
How you expect to fit a polynomial to a random data? You cannot. By the way what is the necessity to fit a polynomial to random data?
Matt J
Matt J el 30 de Sept. de 2020
Editada: Matt J el 30 de Sept. de 2020
Also, order 9 is a rather high degree for a polynomial fit. You're getting into a numerically unstable regime when you go that high. For example, notice that very small errors in the coefficients of poly(1:9) give you not so small errors in the roots:
>> p=poly(1:9) + 1e-7*randn(size(p));
>> roots(p).'
ans =
9.0020 7.9944 7.0060 5.9970 5.0007 3.9999 3.0000 2.0000 1.0000
AS
AS el 1 de Oct. de 2020
I wanted to fit polynomial to see in which order it will fit.
I recommend you use cftool to explore the fits.

Iniciar sesión para comentar.

Categorías

Más información sobre Polynomials en Centro de ayuda y File Exchange.

Preguntada:

AS
el 30 de Sept. de 2020

Respondida:

el 1 de Oct. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by