创建或修改优化选项结构
options = optimset(Name,Value)
optimset
options = optimset
options = optimset(optimfun)
options = optimset(oldopts,Name,Value)
options = optimset(oldopts,newopts)
返回带有使用一个或多个名称-值对参数设置的指定参数的选项。
(with no input or output arguments) 显示参数及其有效值的完整列表。
(with no input arguments) creates an options structure options where all parameters are set to [].
创建与优化函数optimfun相关的所有参数名称和默认值的选项。
创建oldopts的副本,并使用一个或多个名称-值对参数修改指定的参数。
将现有的结构oldopts与新的结构newopts相结合。newopts中的任何非空值参数都会覆盖oldopts中的相应参数。
name | function handle
优化求解器,指定为名称或函数句柄。返回的选项结构只有指定求解器的非空项。
structure
先前的优化选项,指定为结构。除了指定的参数外,输出选项与oldopts相同。
structure
新的优化选项,指定为结构。输出选项与newopts相同,还包括newopts中为空的oldopts的非空参数。
指定可选的、用逗号分隔的Name和Value参数对。Name是参数名称,Value是对应的值。名称必须出现在引号内。可以以任意顺序指定多个名称和值对参数,如Name1、Value1、…、NameN、ValueN。
Example: options = optimset(‘TolX’,1e-6,‘PlotFcns’,@optimplotfval)
‘notify’ (default) | ‘final’ | ‘off’ | ‘none’ | ‘iter’
显示级别,指定为逗号分隔的对,由’ display '和以下值之一组成:
‘off’ (default) | ‘on’
检查函数值是否有效的标志,指定为逗号分隔对,由’FunValCheck’和值’off’或’on’组成。当值为’on’时,当目标函数返回一个复杂或NaN值时,求解器将显示一个错误。
FunValCheck可用于fminbnd, fminsearch和fzero。
500 for fminbnd, 200*(number of variables) for fminsearch (default) | positive integer
函数求值的最大数目,指定为逗号分隔对,由’MaxFunEvals’和一个正整数组成。
MaxFunEvals is available for fminbnd and fminsearch.
500 for fminbnd, 200*(number of variables) for fminsearch (default) | positive integer
最大迭代次数,指定为由’MaxIter’和一个正整数组成的逗号分隔对。
MaxIter is available for fminbnd and fminsearch.
[] (default) | function name | function handle | cell array of function handles
输出函数,指定为逗号分隔的对,由’OutputFcn’和函数名或函数句柄组成。指定多个输出函数作为函数句柄的单元格数组。输出函数在每次迭代之后运行,使您能够监视解决方案流程或停止迭代。有关更多信息,请参见输出函数。
OutputFcn is available for fminbnd, fminsearch, and fzero.
[] (default) | function name | function handle | cell array of function handles
Plot函数,指定为逗号分隔对,由’PlotFcns’和函数名或函数句柄组成。指定多个绘图函数作为函数句柄的单元格数组。在每个迭代之后运行一个绘图功能,使您能够监视解决方案流程或停止迭代。有关更多信息,请参见Plot函数。
The built-in plot functions are as follows:
The PlotFcns option is available for fminbnd, fminsearch, and fzero.
1e-4 (default) | nonnegative scalar
函数值的终止公差,指定为由’TolFun’和一个非负标量组成的逗号分隔对。当相对于初始函数值,当前函数值与前一个值相差小于TolFun时,迭代结束。请参阅公差和停止标准。
TolFun is available for fminsearch only.
1e-4 for fminbnd and fminsearch, eps for fzero, 10epsnorm(c,1)*length© for lsqnonneg (default) | nonnegative scalar
当前点x上的终止公差,指定为由’TolX’和一个非负标量组成的逗号分隔对。相对于x的大小,当当前点与前一点的差异小于TolX时,迭代结束。请参阅公差和停止标准。
TolX is available for all solvers.
structure
Optimization options, returned as a structure. Values for parameters you do not set are [], which causes solvers to use the default values of these parameters.