Maximization problem in MATLAB Optimisation Toolbox
조회 수: 2 (최근 30일)
이전 댓글 표시
Basically by default MATLAB OPtimisation Toolbox fminocon and ga algorithms minimise the objective function.
To maximise normally we use duality prinicple i.e., "multiplying objective function by -1". Will it work same here?
Becasue I have tried doing this and I couldnt get proper results. Is there any solution for this?
Thank you in advance!!
댓글 수: 0
채택된 답변
Matt J
2023년 2월 2일
편집: Matt J
2023년 2월 2일
Will it work same here?
Yes. Example:
fun=@(x) -x^2; %maximize this
xmax=fmincon( @(x) -fun(x) , 1)
It worked!!
But another principal is that you need a good initial guess, when the problem is non-convex. That might be why it "doesn't work" for you.
댓글 수: 7
Matt J
2023년 2월 5일
You're welcome, but please Accept-click the answer to indicate that question is resolved.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!