How do I write inequality constraints within NSGA-II
2 次查看(过去 30 天)
显示 更早的评论
i need to add the constraint 1<x< 3 to my objectve functinos but dont know how to write it
0 个评论
回答(1 个)
Abhishek Gupta
2021-6-17
Hi,
As per my understanding, you want to add a constraint to your function. You can do the same using "if, elseif, else" as follows: -
function my_objective()
...
if (1<=x) && (x<=3)
% <YOUR CODDE>
end
...
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle Swarm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!