solve

Solve an OPTI optimization problem

Syntax

x = solve(optiObj)

x = solve(optiObj,x0)

[x,fval,exitflag,info] = solve(optiObj,x0)

Description

x = solve(optiObj) solves the optimization problem specified by the OPTI object optiObj, and returns the solution x.

x = solve(optiObj,x0) uses the supplied starting guess x0 as the initial solution for the solver. x0 can also be supplied via optiprob, therefore use the calling strategy above. If x0 is not supplied, the solver will attempt to find its own initial solution unless the problem is an NLP - in which case x0 must be supplied.

[x,fval,exitflag,info] = solve(optiObj,x0) also returns the objective function value at the solution, an exitflag indicating the solver's reason for returning, as well as an information structure, described below.

Return Arguments

A common system is used across all solvers to indicate the solver exit status and provide runtime information. This is described below:

exitflag

A number indicating the solver return status:

Value Description
1 Optimal Solution [As determined by the solver - may be locally optimal]
0 Iteration / Time limit / Function Evaluation Limit reached
-1 Infeasible Problem
-2 Unbounded / Solver Error
-3 and below Solver specific errors

info

A structure containing the following fields (only available fields will be returned):

Field Description
Iterations The number of iterations taken by the solver
FuncEvals The number of function evaluations used by the solver (not including gradients)
Nodes The number of nodes searched by the solver (MIP)
Time The execution time of the solver as measured by Matlab (tic + toc)
Algorithm The solver and algorithm used
Status A status string indicating the solver specific exit message
Lambda Lagrange multipliers at the solution (if available)