Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Matlab code and function
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Image Analyst
am 28 Apr. 2017
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
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!