Borrar filtros
Borrar filtros

How to return function handle from fit

16 visualizaciones (últimos 30 días)
Peiyuan ZHU
Peiyuan ZHU el 12 de Mayo de 2017
Respondida: Steven Lord el 12 de Mayo de 2017
Now I need a function handle not a fit object, what should I do?
F_fitted = fit(Phi2_y',Phi2_Phi','gauss8');
This gives a fit object not a handle.

Respuestas (2)

Adam
Adam el 12 de Mayo de 2017
I don't have the curve fitting toolbox, but objects come with a variety of functionality in terms of methods and properties. Maybe this link will help, which comes directly from the main documentation page on the fit function.

Steven Lord
Steven Lord el 12 de Mayo de 2017
Write an anonymous function that simply evaluates the fit.
f = @(x) F_fitted(x)
Alternately, if you describe what function you're trying to call that accepts a function handle but not a fit object, we may be able to offer more specific guidance (or suggest that you file an enhancement request.)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by