How can I manipulate single variable in Integer programming?

I am using bintprog to solve a problem and I could not figure out how to build the equality constrains. For instance I have a 3 x 3 variable matrix x and I want x(1,1)+x(2,1)+x(3,2)=Const. Is there any way to manipulate this variables seperately? I was thinking that I can do that by configuring a matrix A and let A * x = b and one of the items in b will be the one I want but for the rest elements of b is there any way to set them to arbitrary value (so it will not serve as a constrain)?

 Réponse acceptée

Matt J
Matt J le 17 Juin 2015
Modifié(e) : Matt J le 17 Juin 2015
BINTPROG and other solvers in the Optimization Toolbox always interpret the Aeq,beq inputs as specifying the equation Aeq*x(:)=beq(:). So in your case, you would set the beq input to be a scalar beq=Const and Aeq to be a 1x9 row vector,
Aeq=[1 1 0 0 0 1 0 0 0];

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by