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

 Akzeptierte Antwort

Star Strider
Star Strider am 6 Okt. 2014

0 Stimmen

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

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 6 Okt. 2014

Bearbeitet:

am 7 Okt. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by