Reputation: 1335
simple question.. Is it possible to set only one upper bound for lsqcurvefit, without limiting others?
I need something like:
lb = [0 0 0];
ub = [~ ~ 5];
Thanks!
Upvotes: 1
Views: 1703
Reputation: 38032
From help lsqcurvefit
:
X = LSQCURVEFIT(FUN,X0,XDATA,YDATA,LB,UB) defines a set of lower and
upper bounds on the design variables, X, so that the solution is in the range LB <= X <= UB. Use empty matrices for LB and UB if no bounds exist. Set LB(i) = -Inf if X(i) is unbounded below; set UB(i) = Inf if X(i) is unbounded above.
So yes, Dan Becker is right -- using
lb = [ 0 0 0];
ub = [inf inf 5];
will do the trick.
Upvotes: 4