How to define a binary variable in non linear constraints
4 次查看(过去 30 天)
显示 更早的评论
if x(1)+x(2)+x(3)> 0 then x(4)= 1 otherwise x(4)=0
回答(1 个)
Torsten
2024-3-25
Solve two problems:
One with
x(1)+x(2)+x(3)>= 0
x(4)=1
the other with
x(1)+x(2)+x(3)<= 0
x(4)=0
and take the best of the two runs as the solution.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!