error using fmincon requiers following inputs to be of data type double: 'LB', 'UB'
2 次查看(过去 30 天)
显示 更早的评论
Hi, I am facing this above error when I run my code, I have been trying to solve the coupled differential equations using ODE45 solver, the program runs well and good when I use lsqcurvefit, but i get back a warning for bound constraints so I thought I will run the code with fmincon as it could give a minimum of constrained nonlinear variables, but the issue is I am facing the above error in the code, what is the mistake I am doing here please suggest some suggestions to avoid the above error. Thank you in advance.
3 个评论
Stephen23
2023-9-7
编辑:Stephen23
2023-9-7
The FMIINCON documentation
shows that LB and UB must be the 7th and 8th input arguments respectively. Instead of following the documentation, you have provided them as the 5th and 6th inputs. Inventing syntaxes will not work, you need to follow the documentation.
Note that the documentation explains that unspecified inputs e.g. AEQ, BEQ, LB, UB may be [].
回答(1 个)
Bruno Luong
2023-9-7
The low bound and up bounds must be 7th and 8th arguments of fmincon. You do not respect the argument list. Check thedoc fmincon
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!