Dynamic bounds of the LSQCURVEFIT(FUN,X0,XDATA,YDATA,LB,UB)
2 views (last 30 days)
Show older comments
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
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!
Walter Roberson
on 14 Jul 2012
Please do not use "matlab" as a Tag. http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
Answers (0)
See Also
Categories
Find more on Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!