optimoptions
Syntax
· options = optimoptions(SolverName)
· options =optimoptions(SolverName,Name,Value)
· options =optimoptions(oldoptions,Name,Value)
· options =optimoptions(SolverName,oldoptions)
SolverName
fgoalattain
For relevant name-value pairs, consult the options table for your solver:
-
fgoalattainoptions -
fminconoptions -
fminimaxoptions -
fminuncoptions -
fseminfoptions -
fsolveoptions -
gaoptions(in Global Optimization Toolbox) -
gamultiobjoptions(in Global Optimization Toolbox) -
intlinprogoptions -
linprogoptions -
lsqcurvefitoptions -
lsqlinoptions -
lsqnonlinoptions -
particleswarmoptions(in Global Optimization Toolbox) -
patternsearchoptions(in Global Optimization Toolbox) -
quadprogoptions -
simulannealbndoptions(in Global Optimization Toolbox)
Note: optimoptions is recommended instead of optimset for all solvers except fzero, fminbnd, fminsearch, and lsqnonneg.
optimset
Syntax
options =optimset('param1',value1,'param2',value2,...)
optimset
options = optimset
options = optimset(optimfun)
options =optimset(oldopts,'param1',value1,...)
options = optimset(oldopts,newopts)
Previously, the recommended way to set options was to use optimset. Now the general recommendation is to use optimoptions, with some caveats listed below.
optimset still works, and it is the only way to set options for solvers that are available without an Optimization Toolbox™ license: fminbnd, fminsearch, fzero, and lsqnonneg.
Note
Some other toolboxes use optimization options and require you to pass in options created using optimset, not optimoptions. Check the documentation for your toolboxes.
optimoptions organizes options by solver, with a more focused and comprehensive display than optimset:
-
Creates and modifies only the options that apply to a solver
-
Shows your option choices and default values for a specific solver/algorithm
-
Displays links for more information on solver options and other available solver algorithms
intlinprog uses only optimoptions options.
The main difference in creating options is:
-
For
optimoptions, you include the solver name as the first argument. -
For
optimset, the syntax does not include the solver name.
In both cases, you can query or change options by using dot notation. See Set and Change Options and View Options.
For example, compare the display of optimoptions to that of optimset.

本文详细介绍了使用optimoptions和optimset两种方法来配置优化算法参数的过程,并对比了它们之间的主要区别。文章强调对于大部分求解器推荐使用optimoptions,而对于fminbnd等特定求解器则建议使用optimset。
5006

被折叠的 条评论
为什么被折叠?



