This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Create simulated annealing options structure


options = saoptimset
options = saoptimset('param1',value1,'param2',value2,...)
options = saoptimset(oldopts,'param1',value1,...)
options = saoptimset(oldopts,newopts)
options = saoptimset('simulannealbnd')


saoptimset with no input or output arguments displays a complete list of parameters with their valid values.

options = saoptimset (with no input arguments) creates a structure called options that contains the options, or parameters, for the simulated annealing algorithm, with all parameters set to [].

options = saoptimset('param1',value1,'param2',value2,...) creates a structure options and sets the value of 'param1' to value1, 'param2' to value2, and so on. Any unspecified parameters are set to []. It is sufficient to type only enough leading characters to define the parameter name uniquely. Case is ignored for parameter names. Note that for character values, correct case and the complete value are required.

options = saoptimset(oldopts,'param1',value1,...) creates a copy of oldopts, modifying the specified parameters with the specified values.

options = saoptimset(oldopts,newopts) combines an existing options structure, oldopts, with a new options structure, newopts. Any parameters in newopts with nonempty values overwrite the corresponding old parameters in oldopts.

options = saoptimset('simulannealbnd') creates an options structure with all the parameter names and default values relevant to 'simulannealbnd'. For example,


ans = 
          AnnealingFcn: @annealingfast
        TemperatureFcn: @temperatureexp
         AcceptanceFcn: @acceptancesa
                TolFun: 1.0000e-006
        StallIterLimit: '500*numberofvariables'
           MaxFunctionEvaluations: '3000*numberofvariables'
             TimeLimit: Inf
         MaxIterations: Inf
        ObjectiveLimit: -Inf
               Display: 'final'
       DisplayInterval: 10
             HybridFcn: []
        HybridInterval: 'end'
              PlotFcns: []
          PlotInterval: 1
            OutputFcns: []
    InitialTemperature: 100
      ReannealInterval: 100
              DataType: 'double'


The following table lists the options you can set with saoptimset. See Simulated Annealing Options for a complete description of these options and their values. Values in {} denote the default value. You can also view the options parameters by typing saoptimset at the command line.

optimoptions hides the options listed in italics, but saoptimset does not. See Options that optimoptions Hides.



Handle to the function the algorithm uses to determine if a new point is accepted

Function handle |{@acceptancesa}


Handle to the function the algorithm uses to generate new points

Function handle | @annealingboltz | {@annealingfast}


Type of decision variable

'custom' | {'double'}


Level of display

'off' | 'iter' | 'diagnose' | {'final'}


Interval for iterative display

Positive integer | {10}


Termination tolerance on function value

For saoptimset, use TolFun.

Positive scalar | {1e-6}


Automatically run HybridFcn (another optimization function) during or at the end of iterations of the solver

@fminsearch | @patternsearch | @fminunc | @fmincon | {[]}


1-by-2 cell array | {@solver, hybridoptions}, where solver = fminsearch, patternsearch, fminunc, or fmincon {[]}


Interval (if not 'end' or 'never') at which HybridFcn is called

Positive integer | 'never' | {'end'}


Initial value of temperature

Positive scalar | positive vector | {100}


Maximum number of objective function evaluations allowed

For saoptimset, use MaxFunEvals.

Positive integer | {3000*numberOfVariables}


Maximum number of iterations allowed

Positive integer | {Inf}


Number of iterations over which average change in fitness function value at current point is less than options.FunctionTolerance

For saoptimset, use StallIterLimit.

Positive integer | {500*numberOfVariables}


The algorithm stops after running for MaxTime seconds

For saoptimset, use TimeLimit.

Positive scalar | {Inf}


Minimum objective function value desired

Scalar | {-Inf}


Function(s) get(s) iterative data and can change options at run time

For saoptimset, use OutputFcns.

Function handle or cell array of function handles | {[]}


Plot function(s) called during iterations

For saoptimset, use PlotFcns.

Function handle or cell array of function handles | @saplotbestf | @saplotbestx | @saplotf | @saplotstopping | @saplottemperature | {[]}


Plot functions are called at every interval

Positive integer | {1}


Reannealing interval

Positive integer | {100}


Function used to update temperature schedule

Function handle | @temperatureboltz | @temperaturefast | {@temperatureexp}

Introduced in R2007a

Was this topic helpful?