Defining binary variables in Matlab without using the Optimization Toolbox.
3 views (last 30 days)
Show older comments
Hi!
I have been looking on the help page but can't seem to find what I am looking for. I am writing a MILP that has 2 binary variables. One:
q_vk = given as an array of 5 numbers at the beginning of the problem, and is used to determine if another binary variable is 1 or 0 to assign patients to a specific provider. the other binary variable is y_vk where v is the provider, and k is the type of patient. I am trying to make my constraint work to say that q_vk >= y_vk in code, but I cannot do that without defining y_vk to only have a 0 or 1 output. How do I define this y_vk variable at the top of the code without using the Optimization Toolbox installed? There must be a way. This is the line of code I have for one of the constraints but it doesn't seem like it is going to give me the correct output.
fprintf(data,'%d - Y_%d_%d >=0\n', q1k(1),v,k);
Thanks!
3 Comments
Walter Roberson
on 7 Aug 2021
If you are not using the optimization toolbox, MATLAB does not really have decision variables (unless there is some kind of decision variable that is part of the Statistics and Machine Learning toolbox... which is a possibility.)
Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!