MATLAB Examples

The importance of choosing an appropriate solver for optimization problems. It also shows that a single point of non-smoothness can cause problems for Optimization Toolbox™ solvers.

Visually how pattern search optimizes a function. The function is the height of the terrain near Mount Washington, as a function of the x-y location. In order to find the top of Mount

Minimize an objective function subject to nonlinear inequality constraints and bounds using pattern search.

Create and manage options for the pattern search function patternsearch using the optimoptions function in the Global Optimization Toolbox.

Find a minimum of a stochastic objective function using patternsearch. It also shows how Optimization Toolbox™ solvers are not suitable for this type of problem. The example uses a simple

Create and minimize an objective function using Pattern Search in Global Optimization Toolbox.

Find the minimum of Rastrigin's function restricted so the first component of x is an integer. The components of x are further restricted to be in the region 5 \pi\le x(1) \le 20\pi,\ -20\pi\le

How @gacreationlinearfeasible, the default creation function for linearly constrained problems, creates a population for ga. The population is well-dispersed, and is biased to lie on

Solve a mixed integer engineering design problem using the Genetic Algorithm (ga) solver in Global Optimization Toolbox.

The use of a custom output function in the genetic algorithm solver ga. The custom output function performs the following tasks:

Minimize an objective function subject to nonlinear inequality constraints and bounds using the Genetic Algorithm.

Use the genetic algorithm to minimize a function using a custom data type. The genetic algorithm is customized to solve the traveling salesman problem.

Create and manage options for the genetic algorithm function ga using optimoptions in the Global Optimization Toolbox.

Use a hybrid scheme to optimize a function using the Genetic Algorithm and another optimization method. ga can reach the region near an optimum point relatively quickly, but it can take many

Create and minimize a fitness function for the genetic algorithm solver ga using three techniques:

Fit a function to data using lsqcurvefit together with MultiStart .

Use the functions GlobalSearch and MultiStart.

Create and manage options for the multiobjective genetic algorithm function gamultiobj using optimoptins in Global Optimization Toolbox.

Perform a multiobjective optimization using multiobjective genetic algorithm function gamultiobj in Global Optimization Toolbox.

Create a set of points on the Pareto front using both paretosearch and gamultiobj . The objective function has two objectives and a two-dimensional control variable x . The objective

Plot a Pareto front for three objectives. Each objective function is the squared distance from a particular 3-D point. For speed of calculation, write each objective function in vectorized

Examine the tradeoff between the strength and cost of a beam. Several publications use this example as a test problem for various multiobjective algorithms, including Deb et al. [1] and Ray

Optimize using the particleswarm solver. The particle swarm algorithm moves a population of particles called a swarm toward a minimum of an objective function. The velocity of each

Use an output function for particleswarm. The output function plots the range that the particles occupy in each dimension.

Optimize using the particleswarm solver.

Create and minimize an objective function using Simulated Annealing in the Global Optimization Toolbox.

Create and manage options for the simulated annealing function simulannealbnd using optimoptions in the Global Optimization Toolbox.

Use simulated annealing to minimize a function using a custom data type. Here simulated annealing is customized to solve the multiprocessor scheduling problem.

The behavior of three recommended solvers on a minimization problem. The objective function is the multirosenbrock function:

Compares surrogateopt to two other solvers: fmincon , the recommended solver for smooth problems, and patternsearch , the recommended solver for nonsmooth problems. The example uses a

Search for a global minimum by running surrogateopt on a two-dimensional problem that has six local minima. The example then shows how to modify some options to search more effectively.

The surrogateoptplot plot function provides a good deal of information about the surrogate optimization steps. For example, consider the plot of the steps surrogateopt takes on the

Optimize an antenna design using the surrogate optimization solver. The radiation patterns of antennas depend sensitively on the parameters that define the antenna shapes. Typically,

Include nonlinear inequality constraints in a surrogate optimization by using a penalty function. This technique enables solvers that do not normally accept nonlinear constraints to

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Contact your local office