How to maximize a function if I have both integer and continuous variables?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
How to maximize a function if I have both integer and continuous variables? What is the right syntax? I have to use constraints for handling integer variables?
0 Kommentare
Antworten (2)
Matt J
am 26 Okt. 2018
Bearbeitet: Matt J
am 26 Okt. 2018
If the objective and constraints are linear you can use intlinprog(). Otherwise, you would have to resort to ga(). Each of these solvers has an input argument 'IntCon', which you use to specify which variables are integer and which are not.
0 Kommentare
Jeff Miller
am 27 Okt. 2018
Here is an adaptation of fminsearch that allows you to mix both integer and continuous variables: fminsearcharb. It probably won't work well if you have a lot of variables, though.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!