error using fmincon requiers following inputs to be of data type double: 'LB', 'UB'
1 view (last 30 days)
Show older comments
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 Comments
Stephen23
on 7 Sep 2023
Edited: Stephen23
on 7 Sep 2023
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 [].
Answers (1)
Bruno Luong
on 7 Sep 2023
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 Comments
See Also
Categories
Find more on Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!