Maximize objective function using fmincon with a limit
이전 댓글 표시
Please help me with the error in the code; to get the "profit".
Maximize P: (U*y1 - P*y1) + (P*y2 - V*y2)
where 0.4 <= P <= 0.3
f=@x-1*((U*y1 - (x)*y1) + ((x)*y2 - V*y2))
U=2;y1=3;y2=1;V=0.2;
A=[]; q=[]; lb=0.3; ub=0.4;
[ans,ans1]= fmincon(f,A,q,lb,ub);
ans; ans1
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Elementary Math에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!