Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

## Maximizing vs. Minimizing

Global Optimization Toolbox optimization functions minimize the objective or fitness function. That is, they solve problems of the form

`$\underset{x}{\mathrm{min}}f\left(x\right).$`

If you want to maximize f(x), minimize –f(x), because the point at which the minimum of –f(x) occurs is the same as the point at which the maximum of f(x) occurs.

For example, suppose you want to maximize the function

`$f\left(x\right)={x}_{1}^{2}-2{x}_{1}{x}_{2}+6{x}_{1}+4{x}_{2}^{2}-3{x}_{2}.$`

Write your function file to compute

`$g\left(x\right)=-f\left(x\right)=-{x}_{1}^{2}+2{x}_{1}{x}_{2}-6{x}_{1}-4{x}_{2}^{2}+3{x}_{2},$`

and minimize g(x).

Watch now