Curve fitting - periodic function
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I would like to fit a curve to a set of data (I know the function is periodic). The problem is, all the fittings I tried are unable to reproduced the periodicity of the function.
Is there any way to use the curve fitting toolbox to fit a periodic function data set using only 1 period?
Thank you, Alex
0 commentaires
Réponse acceptée
Richard Willey
le 6 Fév 2012
Here's a pretty basic example
X = linspace(0, 2*pi, 100);
X = X';
Y = sin(X) + randn(100,1);
foo = fit(X,Y, 'sin1')
scatter(X,Y);
hold on
plot(foo)
Plus de réponses (1)
Andrew Newell
le 6 Fév 2012
You could try selecting "Sum of sin functions" for the type of fit.
0 commentaires
Voir également
Catégories
En savoir plus sur Interpolation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!