MATLAB Answers

0

how to define a binary variable in GA tool box

Asked by Ayesha Maroof on 7 Dec 2018 at 22:58
Latest activity Commented on by Ayesha Maroof on 9 Dec 2018 at 20:55
Hi all
I am working with a facility location problem where the cost of facility is depending on either opening[1] or not opening a facility.[0].So my one variable is binary.when I go to the tool box it asks for upper and lower bounds.but i want to fix the vaiable to either 0 or 1.How can I do that?
Thanx in advance

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 8 Dec 2018 at 1:29
 Accepted Answer

mark it as an integer variable with lb 0 and ub 1

  4 Comments

Show 1 older comment
you need to include the index of the variable in the intcons list
Thank you Walter.Let me check it
@Walter Roberson thankyou sooooo much.It worked :)

Sign in to comment.