1

简单的问题.. 是否可以只为 lsqcurvefit 设置一个上限,而不限制其他上限?

我需要类似的东西:

lb = [0 0 0];
ub = [~ ~ 5];

谢谢!

4

1 回答 1

4

来自help lsqcurvefit

X = LSQCURVEFIT(FUN,X0,XDATA,YDATA,LB,UB) 定义了一组较低和

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.

所以是的,丹·贝克尔是对的——使用

lb = [   0  0  0];
ub = [inf inf  5]; 

会成功的。

于 2012-10-30T05:27:39.137 回答