Function optimizing matrix under the constraints (vector)
Show older comments
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:

Answers (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 Comments
Torsten
on 18 May 2017
A = [1 1 1 0 0 0 ; 0 0 0 1 1 1]
Best wishes
Torsten.
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

