I want to maximize an objective function using quasi-newton optimization method. But i couldn't find any function for maximizing a function. All inbuilt functions are for minimization. For eg. fminunc in matlab. How can i change my objective function to give it as an input to a minimization function, say fminunc and get the result for maximization.

  • 1
    $\begingroup$ Have you tried multiplying your entire objective function by (-1) ? $\endgroup$
    – Paul
    Sep 19, 2015 at 16:47

1 Answer 1


If you want to maximize f(X) subject to specified constraints (if any), then minimize -f(X) subject to those same constraints. Your optimal objective function will be the negative of -f(X_optimal), where X_optimal is the optimal argument value, which is the same for max f(X) and min -f(X).


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.