Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# GlobalOptimSolution class

Optimization solution

## Description

Information on a local minimum, including location, objective function value, and start point or points that lead to the minimum.

GlobalSearch and MultiStart generate a vector of GlobalOptimSolution objects. The vector is ordered by objective function value, from lowest (best) to highest (worst).

## Construction

When you run them, GlobalSearch and MultiStart create GlobalOptimSolution objects as output.

## Properties

 Exitflag An integer describing the result of the local solver run. For the meaning of the exit flag, see the description in the appropriate local solver function reference page: Fval Objective function value at the solution. Output Output structure returned by the local solver. X Solution point, with the same dimensions as the initial point. X0 Cell array of start points that led to the solution.

## Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB® Programming Fundamentals documentation.

## Examples

Use MultiStart to create a vector of GlobalOptimSolution objects:

```ms = MultiStart;
sixmin = @(x)(4*x(1)^2 - 2.1*x(1)^4 + x(1)^6/3 ...
+ x(1)*x(2) - 4*x(2)^2 + 4*x(2)^4);
problem = createOptimProblem('fmincon','x0',[-1,2],...
'objective',sixmin,'lb',[-3,-3],'ub',[3,3]);
[xmin,fmin,flag,outpt,allmins] = run(ms,problem,30);```

allmins is the vector of GlobalOptimSolution objects:

```allmins

allmins =

1x30 GlobalOptimSolution

Properties:
X
Fval
Exitflag
Output
X0```