Optimization variable zero or one
显示 更早的评论
Hi
I have written my optimization problem in Matlab. The problem has 10 variables, such as x(i), i=1,2...10.
But there is a restriction that x(i) either zero or one.
How can I set these constratints in MATLAB.
Greatly appreciate your help.
Rizvi
回答(1 个)
John D'Errico
2020-11-12
0 个投票
You have 10 variables, which can take on only 2 levels each. Just evaluate the function at all 2^10 = 1024 points and be done with it.
类别
在 帮助中心 和 File Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!