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

 採用された回答

Star Strider
Star Strider 2014 年 10 月 6 日

0 投票

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

質問済み:

2014 年 10 月 6 日

編集済み:

2014 年 10 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by