fit curves by smoothingspline

2 visualizzazioni (ultimi 30 giorni)
yizheng li
yizheng li il 14 Giu 2019
Commentato: Matt J il 14 Giu 2019
I have a sets of data, and I want to plot them in dot then fit them with curve, but the fitted curve doesnt seems fit very well(the curve is so far away from realy point. I'm using the code below for fit, did I make some mistake?
clear all
load positiontest.mat
xx;
Pattern3;
curve3 = fit(xx,Pattern3,'smoothingspline');
figure,
plot(curve3,xx,Pattern2)

Risposte (1)

Matt J
Matt J il 14 Giu 2019
Shouldn't this be,
plot(curve3,xx,Pattern3)
  2 Commenti
yizheng li
yizheng li il 14 Giu 2019
untitled.pngthanks , I just notice thie typo. But even though I fix it, the first half of this graph still seems not fit well
Matt J
Matt J il 14 Giu 2019
You might have to experiment with the SmoothingParam input parameter, e.g.
f = fit(xx,Pattern3,'smoothingspline','SmoothingParam',0.07);

Accedi per commentare.

Categorie

Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by