Genetic Algorithm and Direct Search Toolbox Previous page   Next Page

Maximizing Versus Minimizing

The optimization functions in the Genetic Algorithm and Direct Search Toolbox minimize the objective or fitness function. That is, they solve problems of the form

If you want to maximize f(x), you can do so by minimizing -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

described in the preceding section. In this case, you should write your M-file to compute

and minimize this function.


Previous page  Example -- Writing an M-File Getting Started with the Genetic Algorithm Next page

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS