fmincon instead of lsqcurvefit

3 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);
[p,resnorm,res,EXITFLAG,OUTPUT,LAMBDA,jocob]=lsqcurvefit(@fun725,p0,time,x,pL,pU);
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.

Accepted Answer

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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!