MATLAB Answers

Conversion to logical from optim.prob​lemdef.Opt​imizationC​onstraint is not possible. Expressing a condition for a parameter.

6 views (last 30 days)
Lenilein on 17 Sep 2019
Commented: Lenilein on 17 Sep 2019
I am trying to formulate an mixed integer optimization problem and one of my parameters (say A) depends on my optimization variable (say x), which is a binary variable.
I would like that when x=1, A=a and when x=0, A=b;
I realized that I couldn't express it with an "If function" after getting the error Conversion to logical from optim.problemdef.OptimizationConstraint is not possible.
Going through Matlab resources I found solutions using big M constraints for cases where A is expected to be above a superior value when x takes a certain value. However I couldn't find the case where A has to be equal to a specific value.
Can someone help me expressing this condition?
Thank you! :)


Sign in to comment.

More Answers (0)

Sign in to answer this question.

Translated by