Optimization Toolbox - Equality Contraint for matrix inputs

1 回表示 (過去 30 日間)
Thomas Berry
Thomas Berry 2019 年 12 月 31 日
回答済み: Alan Weiss 2020 年 1 月 2 日
Hi.
This is more a request than a question.
I was wondering if the function fmincon and the likes from the Optimization Toolbox, could support equality contraints for matrix inputs i.e, for the constraints of type
where x is the variable to optimize and, currently, has to be a column vector.
The work around is, obviously to flatten x to a column, same goes with $beq#$. Biggest drawback is that will have to increase a lot in size.
The reason why I want this is because I want to apply the "same kind" of contraint to columns 1 and 2 of x.
This seems to be not possible because I get the following error:
Error using fmincon (line 301)
Row dimension of Aeq is inconsistent with length of beq.
Thank You.

回答 (1 件)

Alan Weiss
Alan Weiss 2020 年 1 月 2 日
You might find that this type of structured constraint is handled most easily using the problem-based approach. See, for example, Solve Sudoku Puzzles Via Integer Programming: Problem-Based.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

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