linprog: can you manipulate the solver to give you an output you desire?

1 次查看(过去 30 天)
I have a linear programming problem. After running linprog, I get a solution (attached .png).
I have 7 groups. For each group, there are three solutions per row (three different numbers). I want the solver to output only one solution, in other words, one number is greater than zero and the other two numbers are zero.
Is it possible to implement such restrictions before linprog runs? It would go something like this:
GROUP 1
if column1solution > 0
column2solution = 0
column3solution = 0
elseif column2solution > 0
column1solution = 0
column3solution = 0
elseif column3solution > 0
column1solution = 0
column2solution = 0
end
It would search if the first solution is greater than zero. If so, it would accept that as the solution and set the other solutions to zero. If not, it would search if the second solution is greater than zero. If not, it would search if the third solution is greater than zero.
Is this possible to implement as the solver is compiling the solution?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver 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