writing an objective function (intlinprog)

1 回表示 (過去 30 日間)
Gratitude Kim
Gratitude Kim 2017 年 9 月 5 日
編集済み: John D'Errico 2017 年 9 月 5 日
Hi, I am supposed to write minimize P where P>=0. Thus, I created a variable P and declared it to be >=0. Using intlinprog function, When I wrote f=P; I am having this error. Error using intlinprog (line 121) INTLINPROG requires the following inputs to be of data type double: 'f'.
Appreciate your kind assistance.
  2 件のコメント
Matt J
Matt J 2017 年 9 月 5 日
intlinprog doesn't accept symbolic-type variables as input. You should describe the problem more fully so we can determine if intlinprog is at all applicable to what you are doing.
If you are minimizing P subject to P>=0 isn't the solution simply P=0?
John D'Errico
John D'Errico 2017 年 9 月 5 日
編集済み: John D'Errico 2017 年 9 月 5 日
intlinprog does not take a general function as an objective. It does not take a symbolic variable as an objective. intlinprog takes ONLY a linear combination of the variables as an objective, so classically a linear programming problem, where some or all of the variables must be integer. So you need to explain what you want to do.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeFilter Banks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by