How to maximise the objective function with constraints and plot the solution
이전 댓글 표시
I want to maximise the objective function with respect to x
function=a*ln(1+x)+b(c-x)
subjected to constraints : x,min<=x<=x,max
given parameters are a,b,c.(Randamly I choose some values but it shows error as 'Index exceeds the number of array elements. Index must not exceed 1",how to correct this?)
Also plot the x verses function graph.
채택된 답변
추가 답변 (1개)
William Rose
2022년 2월 27일
0 개 추천
The routine fmincon() is good for this. The name is short for function minimization with constraints. Minimize the negative of your function in order to maximize.
카테고리
도움말 센터 및 File Exchange에서 Object Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



