How do I write inequality constraints within NSGA-II

4 ビュー (過去 30 日間)
Lily McIvor
Lily McIvor 2021 年 6 月 14 日
回答済み: Abhishek Gupta 2021 年 6 月 17 日
i need to add the constraint 1<x< 3 to my objectve functinos but dont know how to write it

回答 (1 件)

Abhishek Gupta
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

カテゴリ

Help Center および File ExchangeQuadratic Programming and Cone Programming についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by