How to define if/else non linear constraint in an optimization problem
2 次查看(过去 30 天)
显示 更早的评论
if x(1)+x(2)+x(3)= 0 then x(4)= 0
elseif 0<x(1)+x(2)+x(3)<20 then x(4)=10
elseif 20<x(1)+x(2)+x(3)<60 then x(4)=30
0 个评论
回答(1 个)
Bruno Luong
2024-3-25
编辑:Bruno Luong
2024-3-25
Simply solve three different optimization pbs with the three repectively constraints independently and ignore the two other, then select the best of the three solutions.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!