MATLAB Examples

Perform nonlinear fitting of complex-valued data. While most Optimization Toolbox™ solvers and algorithms operate only on real-valued data, least-squares solvers and fsolve can work on

Fit a nonlinear function to data using several Optimization Toolbox™ algorithms.

Recover a blurred image by solving a large-scale bound-constrained linear least-squares optimization problem.

Create a multiperiod inventory model in the problem-based framework. The problem is to schedule production of fertilizer blends over a period of time using a variety of ingredients whose

Use the problem-based approach to solve an investment problem with deterministic returns over a fixed number of years T . The problem is to allocate your money over available investments to

Solve an assignment problem by binary integer programming using the intlinprog function. For the problem-based approach to this problem, see

Use the linprog solver in Optimization Toolbox® to solve an investment problem with deterministic returns over a fixed number of years T . The problem is to allocate your money over available

Solve a Sudoku puzzle using binary integer programming.

Solve a Mixed-Integer Quadratic Programming (MIQP) portfolio optimization problem using the intlinprog Mixed-Integer Linear Programming (MILP) solver. The idea is to iteratively

Set up and solve a mixed-integer linear programming problem. The problem is to find the optimal production and distribution levels among a set of factories, warehouses, and sales outlets.

Schedule two gas-fired electric generators optimally, meaning to get the most revenue minus cost. While the example is not entirely realistic, it does show how to take into account costs

Use binary integer programming to solve the classic traveling salesman problem. This problem involves finding the shortest closed tour (path) through a set of stops (cities). In this case

Solve an assignment problem by binary integer programming using the optimization problem approach. For the solver-based approach, see

Solve a Sudoku puzzle using binary integer programming. For the solver-based approach, see Solve Sudoku Puzzles Via Integer Programming: Solver-Based .

Solve a Mixed-Integer Quadratic Programming (MIQP) portfolio optimization problem using the problem-based approach. The idea is to iteratively solve a sequence of mixed-integer linear

Solve a nonlinear filter design problem using a minimax optimization algorithm, fminimax , in Optimization Toolbox™. Note that to run this example you must have the Signal Processing

Solve a pole-placement problem using the multiobjective goal attainment method. This algorithm is implemented in the function fgoalattain .

Use the Symbolic Math Toolbox™ functions named jacobian and matlabFunction to provide derivatives to optimization solvers. Optimization Toolbox™ solvers are usually more accurate and

Minimize Rosenbrock's "banana function":

Use semi-infinite programming to investigate the effect of uncertainty in the model parameters of an optimization problem. We will formulate and solve an optimization problem using the

This example was authored by the MathWorks community.

Solve portfolio optimization problems using the interior-point quadratic programming algorithm in quadprog. The function quadprog belongs to Optimization Toolbox™.

Determine the shape of a circus tent by solving a large-scale quadratic optimization problem. The shape of a circus tent is determined by a constrained optimization problem. We will solve

How to speed up the minimization of an expensive optimization problem using functions in Optimization Toolbox™ and Global Optimization Toolbox. In the first part of the example we solve the

Use two nonlinear optimization solvers and how to set options. The nonlinear solvers that we use in this example are fminunc and fmincon .

This examples illustrates how to perform a FORM analysis on a discrete (0 or 1) failure response. In the example we'll compare a traditional Monte Carlo method with FORM. This example is was

We propose two fuzzy portfolio optimization models based on the Markowitz Mean-Variance approach. The first model involves trapezoidal fuzzy numbers to extent statistical data, which

This demo was adapted from a 2009 digest article: Improving Optimization Performance with Parallel Computing

Time series of acceleration records are simulated using a stationnary process that is "weighted" by an envelopp function. The function that fullfills this procedure is 'seismSim'.

This code is an applicatino of EMOO by using Genetic algorithms to solve the following simple constrained problem: Draw the biggest possible circle in a 2D space filled with stars without

Choose your country 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 location from the following list:

See all countries