1

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

4
  • Are you asking about multiobjective optimiziation? Commented Aug 19, 2013 at 18:25
  • No, multivariable. I need to minimize a function for two variables. That is argmin. Commented Aug 19, 2013 at 18:26
  • 2
    fminunc should work then as long as your function returns a scalar. Commented Aug 19, 2013 at 18:26
  • Oh it works for multiple variables too. Good! Commented Aug 19, 2013 at 18:31

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

3 Comments

By the way, is there a book I can study on the various optimization stuff available in Matlab?
Sorry, I just go by the documentation on the Optimization toolbox!
There is a book "Applied Optimization with MATLAB Programming". I found it with a quick Google search. I would still go with the official documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.