Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Matlab code and function
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Image Analyst
le 28 Avr 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
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!