Function optimizing matrix under the constraints (vector)
古いコメントを表示
I'm having problem with finding a function that optimizes a matrix under specific constraints. In my task I have two matrices (K and C) of the same dimensions (SxP).The K matrix has test results in the range of 0 to 10 while Matrix c is a zero-one matrix, selecting the best result in the matrix K. The C matrix has two constraints:
a)

Where SP is the vector representing the maximum number of selected results in a given row
b)

My main task is to choose the best results in the matrix:

回答 (1 件)
Once you have your objective and constraints expressed as matrix-vector multiplications, the problem is a straightforward application of intlinprog().
Summation along columns of C can be expressed as a matrix-vector multiplication A*C(:) where A=kron(eye(S),ones(1,P)). Summation along rows can be expressed the same way with A=kron(ones(1,S),eye(P)). The double summation for Q can be epxressed can be expressed K(:).'(C(:)).
2 件のコメント
Torsten
2017 年 5 月 18 日
A = [1 1 1 0 0 0 ; 0 0 0 1 1 1]
Best wishes
Torsten.
カテゴリ
ヘルプ センター および File Exchange で Linear Least Squares についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


