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

5 次查看(过去 30 天)
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.

采纳的回答

Matt J
Matt J 2013-12-26
编辑:Matt J 2013-12-26
anonf=@(x) f(x)

更多回答(1 个)

The Matlab Spot
The Matlab Spot 2013-12-26
编辑:The Matlab Spot 2013-12-26
Refer Anonymous Functions for further details

类别

Help CenterFile Exchange 中查找有关 Fit Postprocessing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by