Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Matlab code and function
7 ビュー (過去 30 日間)
古いコメントを表示
Could you please explain to me the following Queistions: If I have:
f(x)=-2x^2+Lx
Constraints x is in the feasible set [0,L/2] If the question is: give df/dx= -2x + L;
- write a function that numerically solves df/dx = -4x+ L=0
- how to solve df/dx = 0; directly use the solution x*=L/4.
- Finally how can I find max {f(0),f(x*),f(L/2)}
1 件のコメント
Image Analyst
2017 年 4 月 28 日
I cannot explain the difference between -2x + L and -4x+L unless it's just a typo you made. I suggest you ask your instructor.
Otherwise use linspace(0 to make up a vector of x values, and use the max() function. You might use inputdlg() to ask the user for the L value, and the starting and stopping value of x. http://www.mathworks.com/matlabcentral/answers/8626-how-do-i-get-help-on-homework-questions-on-matlab-answers
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!