MATLAB Answers

fmincon instead of lsqcurvefit

28 views (last 30 days)
Mohammad Nidal
Mohammad Nidal on 27 Feb 2021
Edited: Matt J on 2 Mar 2021
options = optimoptions(@lsqcurvefit,'Algorithm','levenberg-marquardt','MaxIter',10000,'TolX',1e-12);
While using this we are not getting proper value. How can we implement 'fmincon' or someother optimisation tools.
  1 Comment
Star Strider
Star Strider on 27 Feb 2021
Note that ‘proper value’ is a matter of interpretation. It depends on what ‘fun725’ is, how you wrote it, and what initial parameter estimates you provided.
Some of the Global Optimization Toolbox functions can search the entire parameter space for the best parameter set, so using it would likely be appropriate.

Sign in to comment.

Answers (1)

Shadaab Siddiqie
Shadaab Siddiqie on 2 Mar 2021
If the problem is data fitting, then you should use 'lsqcurvefit' if possible. If the problem has nonlinear constraints, then see the random discussion.
if the problem is to find minimum, then you should use 'fmincon' if possible. It workes for nonlinear multivariable function.

Community Treasure Hunt

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

Start Hunting!