Question

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

Était-ce utile?

La solution

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).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top