matlab:optimset的用法

您所在的位置:网站首页 matlab中的fzero函数 matlab:optimset的用法

matlab:optimset的用法

2023-09-08 03:00| 来源: 网络整理| 查看: 265

optimset

创建或修改优化选项结构

syntax

options = optimset(Name,Value) optimset options = optimset options = optimset(optimfun) options = optimset(oldopts,Name,Value) options = optimset(oldopts,newopts)

description options = optimset(Name,Value)

返回带有使用一个或多个名称-值对参数设置的指定参数的选项。

optimset

(with no input or output arguments) 显示参数及其有效值的完整列表。

options = optimset

(with no input arguments) creates an options structure options where all parameters are set to [].

options = optimset(optimfun)

创建与优化函数optimfun相关的所有参数名称和默认值的选项。

options = optimset(oldopts,Name,Value)

创建oldopts的副本,并使用一个或多个名称-值对参数修改指定的参数。

options = optimset(oldopts,newopts)

将现有的结构oldopts与新的结构newopts相结合。newopts中的任何非空值参数都会覆盖oldopts中的相应参数。

Input Arguments optimfun — Optimization solver

name | function handle 优化求解器,指定为名称或函数句柄。返回的选项结构只有指定求解器的非空项。

oldopts — Previous optimization options

structure 先前的优化选项,指定为结构。除了指定的参数外,输出选项与oldopts相同。

newopts — New optimization options

structure 新的优化选项,指定为结构。输出选项与newopts相同,还包括newopts中为空的oldopts的非空参数。

Name-Value Pair Arguments

指定可选的、用逗号分隔的Name和Value参数对。Name是参数名称,Value是对应的值。名称必须出现在引号内。可以以任意顺序指定多个名称和值对参数,如Name1、Value1、…、NameN、ValueN。

Example: options = optimset(‘TolX’,1e-6,‘PlotFcns’,@optimplotfval)

‘Display’ — Level of display

‘notify’ (default) | ‘final’ | ‘off’ | ‘none’ | ‘iter’

显示级别,指定为逗号分隔的对,由’ display '和以下值之一组成:

‘notify’ — Display output only if the function does not converge.‘final’ — Display just the final output.‘off’ or ‘none’ — Display no output.‘iter’ — Display output at each iteration (not available for lsqnonneg). 显示可用于所有优化求解器。 ‘FunValCheck’ — Check whether function values are valid

‘off’ (default) | ‘on’

检查函数值是否有效的标志,指定为逗号分隔对,由’FunValCheck’和值’off’或’on’组成。当值为’on’时,当目标函数返回一个复杂或NaN值时,求解器将显示一个错误。

FunValCheck可用于fminbnd, fminsearch和fzero。

‘MaxFunEvals’ — Maximum number of function evaluations

500 for fminbnd, 200*(number of variables) for fminsearch (default) | positive integer

函数求值的最大数目,指定为逗号分隔对,由’MaxFunEvals’和一个正整数组成。

MaxFunEvals is available for fminbnd and fminsearch.

‘MaxIter’ — Maximum number of iterations

500 for fminbnd, 200*(number of variables) for fminsearch (default) | positive integer

最大迭代次数,指定为由’MaxIter’和一个正整数组成的逗号分隔对。

MaxIter is available for fminbnd and fminsearch.

‘OutputFcn’ — Output function

[] (default) | function name | function handle | cell array of function handles

输出函数,指定为逗号分隔的对,由’OutputFcn’和函数名或函数句柄组成。指定多个输出函数作为函数句柄的单元格数组。输出函数在每次迭代之后运行,使您能够监视解决方案流程或停止迭代。有关更多信息,请参见输出函数。

OutputFcn is available for fminbnd, fminsearch, and fzero.

‘PlotFcns’ — Plot functions

[] (default) | function name | function handle | cell array of function handles

Plot函数,指定为逗号分隔对,由’PlotFcns’和函数名或函数句柄组成。指定多个绘图函数作为函数句柄的单元格数组。在每个迭代之后运行一个绘图功能,使您能够监视解决方案流程或停止迭代。有关更多信息,请参见Plot函数。 The built-in plot functions are as follows:

@optimplotx plots the current point.@optimplotfval plots the function value.@optimplotfunccount plots the function count (not available for fzero).

The PlotFcns option is available for fminbnd, fminsearch, and fzero.

‘TolFun’ — Termination tolerance on function value

1e-4 (default) | nonnegative scalar

函数值的终止公差,指定为由’TolFun’和一个非负标量组成的逗号分隔对。当相对于初始函数值,当前函数值与前一个值相差小于TolFun时,迭代结束。请参阅公差和停止标准。

TolFun is available for fminsearch only.

‘TolX’ — Termination tolerance on x, the current point

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.

Output Arguments options — Optimization options

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.

Limitations

在这里插入图片描述



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3