How to construct an anonymous function from the result of the fit command?

5 vues (au cours des 30 derniers jours)
Federico
Federico le 26 Déc 2013
Commenté : Federico le 26 Déc 2013
Hello,
I am trying to do some data fitting with a data set that resembles an air bubble when plotted. I am trying to obtain a function that defines the surface of the bubble. The following result perfectly fits the the profile.
f=fit(x(:,2),-y(:,1),'smoothingspline')
plot(f,x(:,2),-y(:,1)
Now, I would like to create an anonymous function. How can I accomplish this?
Thank you.

Réponse acceptée

Matt J
Matt J le 26 Déc 2013
Modifié(e) : Matt J le 26 Déc 2013
anonf=@(x) f(x)

Plus de réponses (1)

The Matlab Spot
The Matlab Spot le 26 Déc 2013
Modifié(e) : The Matlab Spot le 26 Déc 2013
Refer Anonymous Functions for further details

Catégories

En savoir plus sur Fit Postprocessing 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!

Translated by