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

Recover a blurred image by solving a large-scale bound-constrained linear least-squares optimization problem. The example uses the problem-based approach. For the solver-based

Fit parameters of an ODE to data in two ways. The first shows a straightforward fit of a constant-speed circular path to a portion of a solution of the Lorenz system, a famous ODE with sensitive

Problem-based approaches for solving the problem

Recover a blurred image by solving a large-scale bound-constrained linear least-squares optimization problem. The example uses the solver-based approach. For the problem-based

Formulate a linear least squares problem using the problem-based approach.

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

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

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

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 optimization problem approach. For the solver-based approach, see Office Assignments by Binary Integer Programming:

Solve a cutting stock problem using linear programming with an integer linear programming subroutine. The example uses the problem-based approach. For the solver-based approach, see

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

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

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

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

Solve a cutting stock problem using linear programming with an integer linear programming subroutine. The example uses the solver-based approach. For the problem-based approach, 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

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

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

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

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

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

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

Create an initial point for an optimization problem that has named index variables. For named index variables, often the easiest way to specify an initial point is to use the findindex

Optimization variables can use names for indexing elements. You can give the names when you create a variable or afterward. For example, give the names while creating the variable.

You can create and debug some problems easily by using named index variables. For example, consider the variable x that is indexed by the names in vars :

Solve portfolio optimization problems using the problem-based approach. For the solver-based approach, see docid:optim_ug.mw_77a68b16-ab47-4689-adc9-5e72ead3ea3a.

Determine the shape of a circus tent by solving a quadratic optimization problem. The tent is formed from heavy, elastic material, and settles into a shape that has minimum potential energy

The value of using sparse arithmetic when you have a sparse problem. The matrix has n rows, where you choose n to be a large value, and a few nonzero diagonal bands. A full matrix of size n -by- n can

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

Formulate and solve a scalable bound-constrained problem with a quadratic objective function. The example shows the solution behavior using several algorithms. The problem can have any

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

Demonstrates optimizing a storage facility and valuing a storage contract using intrinsic valuation. The optimization involves finding the optimal positions in a set of forward natural

Revisit the optimal ITAE transfer function for step input using numerical optimization and digital computer.

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'.

The toolbox is designed to estimate the parameters of a regime switching copula model, assuming two regimes. Each regime can be described by any of the following five copulas:

Author : Adham KALOUN

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

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