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

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개)

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

2013년 12월 26일

댓글:

2013년 12월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by