This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Genetic Algorithm

Genetic algorithm solver for mixed-integer or continuous-variable optimization, constrained or unconstrained


expand all

gaFind minimum of function using genetic algorithm
gaoptimgetObtain values of genetic algorithm options structure
gaoptimsetCreate genetic algorithm options structure
optimoptionsCreate optimization options
resetoptionsReset options


Genetic Algorithm Optimization Basics

Minimize Rastrigin's Function

Presents an example of solving an optimization problem using the genetic algorithm.

Options and Outputs

Shows how to choose input options and output arguments.

Nonlinear Constraints Using ga

An example showing how to use various types of constraints.

Global vs. Local Minima Using ga

An examples showing how to search for a global minimum.

Common Tuning Options

Set Maximum Number of Generations

Shows how to adjust the maximum generations option to obtain a better result.

Population Diversity

Shows the importance of population diversity, and how to set it.

Fitness Scaling

Describes fitness scaling, and how it affects the progress of ga.

Vary Mutation and Crossover

Shows the effect of the mutation and crossover parameters in ga.

Include a Hybrid Function

Shows how to use a hybrid function to obtain a more accurate local minimum.

Mixed Integer Optimization

Mixed Integer Optimization

Solve mixed integer programming problems, where some variables must be integer-valued

Solving a Mixed Integer Engineering Design Problem Using the Genetic Algorithm

Example showing how to use mixed-integer programming in ga, including how to choose from a finite list of values.

Specialized Tasks

Resume ga

Shows how to continue optimizing ga from the final population.

Reproduce Results

Shows how to reproduce results by resetting the random seed.

Run ga from a File

Provides an example of running ga using a set of parameters to search for the most effective setting.

Use Exported Options and Problems

Shows how to create and use a problem structure or a set of options.

Vectorize the Fitness Function

How to gain speed using vectorized function evaluations.

Create Custom Plot Function

Shows how to create and use a custom plot function in ga.

Custom Output Function for Genetic Algorithm

This example shows the use of a custom output function in ga.

Optimize an ODE in Parallel

Optimizing an objective given by the solution to an ODE using patternsearch or ga in serial or parallel.

Genetic Algorithm Background

What Is the Genetic Algorithm?

Introduces the genetic algorithm.

Genetic Algorithm Terminology

Explains some basic terminology for the genetic algorithm.

How the Genetic Algorithm Works

Presents an overview of how the genetic algorithm works.

Nonlinear Constraint Solver Algorithms

Explains the Augmented Lagrangian Genetic Algorithm (ALGA) and penalty algorithm.

Reproduce Results in Optimization App

To reproduce the results of the last run of the genetic algorithm, select the Use random states from previous run check box.

Genetic Algorithm Options

Describes the options for the genetic algorithm.

Was this topic helpful?