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

1 visualización (últimos 30 días)
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?

Respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by