MATLAB: Lsqnonlin set some parameters constant and others nonconstant

lsqnonlinmathematicsMATLABnonlinear optimizationoptimization

Hello,
Let's say have a 1xN vector of parameters and I want some of them to be constant (ie. not change during the optimization). I want to be able to dynamically set which parameters are constant based on user input. Looking at the lsqnonlin documentation it looks like this is possible by setting lb(i) = ub(i) = x0(i) which forces the x0(i) to be the same through the entire optimization.
If some values of lb(i) and ub(i) are set to x0(i) to indicate constant parameters, what should the other values be set to to indicate non-constant parameters? Should the bounds simply be set to -infinity and +infinity?
Thanks!

Best Answer

Yes, assuming there are no finite bounds you'd like to place on them.