| Genetic Algorithm and Direct Search Toolbox | ![]() |
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
| Example -- Writing an M-File | Getting Started with the Genetic Algorithm | ![]() |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |