Dynamic bounds of the LSQCURVEFI​T(FUN,X0,X​DATA,YDATA​,LB,UB)

2 views (last 30 days)
I am trying to update my "LB" and "UB" constraints within the LSQCURVEFIT as it fits, dynamically, but I am not sure how to do that.
Is there any way to do so (for example by making them "global", or by using any other trick)?
  4 Comments
Star Strider
Star Strider on 13 Jul 2012
I believe ‘lsqcurvefit’ only looks at the bounds once, then uses them to calculate its Lagrange multipliers. The only way I can think of to get around this so you can change the bounds in the process of fitting your parameters is to set your ‘options’ structure to a very small number of iterations and function evaluations (perhaps 20), then put your call to ‘lsqcurvefit’ in a ‘for’ loop, updating your bounds at each iteration, and using the previous outputs of ‘lsqcurvefit’ (parameter estimates and anything else necessary) as inputs to the next iteration for as long as you need the loop to run.
Have fun!

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!