Can anyone tell me what mistake I am making here? Can you please suggest any changes which make this code work? Thank you.

 Respuesta aceptada

Star Strider
Star Strider el 6 de Oct. de 2014

0 votos

Objective functions for lsqcurvefit and nlinfit have to have the parameter argument as the first argument and the dependent variable as the second argument.
This should work:
fun = @(x,xdata) x(1).*sin((x(2).*xdata)+x(3)); %function handle for approx curve

Más respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 6 de Oct. de 2014

Editada:

el 7 de Oct. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by