matlab:lsqcurvefit,只有一个上限

matlab:lsqcurvefit,只有一个上限,matlab,least-squares,Matlab,Least Squares,简单的问题。。是否可以只为lsqcurvefit设置一个上限,而不限制其他上限 我需要像这样的东西: lb = [0 0 0]; ub = [~ ~ 5]; 谢谢 来自帮助lsqcurvefit: X=LSQCURVEFITFUN、X0、XDATA、YDATA、LB、UB定义了一组下限和下限 upper bounds on the design variables, X, so that the solution is in the range LB <= X <= UB. Use

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

我需要像这样的东西:

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

来自帮助lsqcurvefit:

X=LSQCURVEFITFUN、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.
将完成此操作。

来自帮助lsqcurvefit:

X=LSQCURVEFITFUN、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.

我会成功的。

我没有时间测试,所以没有把它作为答案。。。但是将限制指定为+inf有效吗?这就是我过去使用曲线拟合工具箱中的拟合函数所做的。我没有时间测试它,所以没有把它作为答案。。。但是将限制指定为+inf有效吗?这就是我过去使用曲线拟合工具箱中的拟合函数进行拟合的方式。