Main Content

Single Solution

You obtain the single best solution found during the run by calling run with the syntax

[x,fval,exitflag,output] = run(...);
  • x is the location of the local minimum with smallest objective function value.

  • fval is the objective function value evaluated at x.

  • exitflag is an exit flag for the global solver. Values:

    Global Solver Exit Flags

    2At least one feasible local minimum found. Some runs of the local solver did not converge.
    1At least one feasible local minimum found. All runs of the local solver converged (had positive exit flag).
    0No local minimum found. Local solver called at least once, and at least one local solver exceeded the MaxIterations or MaxFunctionEvaluations tolerances.
    -1One or more local solver runs stopped by the local solver output or plot function.
    -2No feasible local minimum found.
    -5MaxTime limit exceeded.
    -8No solution found. All runs had local solver exit flag -2 or lower, not all equal -2.
    -10Failures encountered in user-provided functions.
  • output is a structure with details about the multiple runs of the local solver. For more information, see Global Output Structures.

The list of outputs is for the case exitflag > 0. If exitflag <= 0, then x is the following:

  • If some local solutions are feasible, x represents the location of the lowest objective function value. “Feasible” means the constraint violations are smaller than problem.options.ConstraintTolerance.

  • If no solutions are feasible, x is the solution with lowest infeasibility.

  • If no solutions exist, x, fval, and output are empty entries ([]).

Related Topics