How to maximize a function if I have both integer and continuous variables?

2 ビュー (過去 30 日間)
Mr M.
Mr M. 2018 年 10 月 26 日
コメント済み: Mr M. 2018 年 10 月 29 日
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?

回答 (2 件)

Matt J
Matt J 2018 年 10 月 26 日
編集済み: Matt J 2018 年 10 月 26 日
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.

Jeff Miller
Jeff Miller 2018 年 10 月 27 日
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.
  1 件のコメント
Mr M.
Mr M. 2018 年 10 月 29 日
I would like to use the Optimization Toolbox

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by