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 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



