Fitting Curve passing through zero using CFTOOL
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Giuseppe Naselli
il 16 Gen 2014
Modificato: Mischa Kim
il 16 Gen 2014
Hi All,
below the data from a damper dyno test (attached). As you can see this shows some hysteresis.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155164/image.jpeg)
I was interested in having only one curve passing basically in the middle (a sort of average between the bump and rebump stroke) I obtained this using the cftool (and help from the matworks answer:). In particular, I achieved that with the followings
% Create a smoothing spline fit with the parameter I specified
Fit_of_the_Data = fit(Velocity, Force, 'smoothingspline', 'SmoothingParam', 0.025)
% Create a variable with the point of the fit
Data_fitted = feval(Data_Fit,Velocity);
The fitting result is "more or less" fine (see below)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155165/image.jpeg)
However, I wish my fitting curve to pass through zero . How can I do that?
Thanks in advance
G
0 Commenti
Risposta accettata
Mischa Kim
il 16 Gen 2014
Modificato: Mischa Kim
il 16 Gen 2014
Hello Giuseppe,
you could use a simple, brute-force approach to get a little closer: add a couple of (0,0) data points to the force and velocity vectors and re-do the curve fitting. If forcing the curve through (0,0) does make sense for your application is something you need to decide.
0 Commenti
Più risposte (0)
Vedere anche
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!