Reputation: 5805
How to minimize multivariate function in Matlab by using derivatives?
So far, for minimizing single variable functions I used fminunc, but now I need to work with multivariate functions.
Thank you
Upvotes: 1
Views: 763
Reputation: 34621
Use fminunc
. If you want to use the gradient, just return it as the 2nd output of your objective function. You'll also need to indicate in an options
object that you are passing the gradient.
options = optimoptions('fminunc','GradObj','on');
I believe the documentation has info on passing the Hessian (if one exists).
Upvotes: 3