1

I am using the following matlab tool to solve my linear equations
x = linprog(f,A,b,Aeq,beq,lb,ub) all things going well with me, but the result of x vector not integer values. so how can I set the x vector to be integer value or take value 0 or 1 only.(I mean solve linear equations for integer result).

let me explain more: if I want to min x for the objective function 8X1 + X2 subject to
x1+2x2≥−14, −4x1−x2≤−33, 2x1+x2≤20 the result of X1,X2 not integer value.

1 Answer 1

2

If you have Matlab version 2014a above, then there is intlinprog for what you are looking for.

UPDATE: Since you have Matlab 2012b, so i strongly suggest you to use this perfect tool at first, but you need something called Internet connection [j/k :-)]. By the way, there are some solutions:

  1. something on Matlab exchange.
  2. GLPK (GNU Linear Programming Kit)
  3. answered question on stackoverflow
Sign up to request clarification or add additional context in comments.

1 Comment

for sorry I am using matlab 2012b, Do you know any way to do that on matlab 2012b?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.