创建或编辑一个最优化参数选项
句法规则
options = optimset('param1',value1,'param2',value2,...) %设置所有参数及其值,未设置的为默认值
options = optimset(optimfun) %设置与最优化函数有关的参数为默认
options = optimset(oldopts,'param1',value1,...) %复制一个已存在的选项,修改特定项
options = optimset(oldopts,newopts) %用另一个新选项合并目前选项因素
'off' 表示不显示输出; 'iter' 显示每次迭代的结果; 'final' 只显示最终结果; 'notify' 只在函数不收敛的时候显示结果. | ||
结束迭代的X值. |
L - 只用于大规模数据拟合
M - 中等规模
B - 两者都可以
Compare user-supplied analytic derivatives (gradients or Jacobian) to finite differencing derivatives. | fgoalattain, fmincon,fminimax, fminunc, fseminf,fsolve, lsqcurvefit, lsqnonlin | ||
Print diagnostic information about the function to be minimized or solved. | All but fminbnd,fminsearch, fzero, andlsqnonneg | ||
Maximum change in variables for finite difference derivatives. | fgoalattain, fmincon,fminimax, fminunc, fseminf,fsolve, lsqcurvefit, lsqnonlin | ||
Minimum change in variables for finite difference derivatives. | fgoalattain, fmincon,fminimax, fminunc, fseminf,fsolve, lsqcurvefit, lsqnonlin | ||
Level of display. 'off' displays no output; 'iter' displays output at each iteration; 'final' displays just the final output; 'notify' displays output only if function does not converge. | All. See the individual function reference pages for the values that apply. | ||
Number of goals to achieve exactly (do not over- or underachieve). | |||
Gradients for the nonlinear constraints defined by the user. | |||
Gradient(s) for the objective function(s) defined by the user. | |||
If 'on', function uses user-defined Hessian, or Hessian information (when using HessMult), for the objective function. If 'off', function approximates the Hessian using finite differences. | |||
Sparsity pattern of the Hessian for finite differencing. The size of the matrix is n-by-n, where n is the number of elements in x0, the starting point. | |||
If 'on', function uses user-defined Jacobian, or Jacobian information (when using JacobMult), for the objective function. If 'off', function approximates the Jacobian using finite differences. | |||
Sparsity pattern of the Jacobian for finite differencing. The size of the matrix is m-by-n, where m is the number of values in the first argument returned by the user-specified function fun, and n is the number of elements in x0, the starting point. | |||
fmincon, fminunc,fsolve, linprog, lsqcurvefit,lsqlin, lsqnonlin, quadprog | |||
fgoalattain, fminbnd,fmincon, fminimax,fminsearch, fminunc,fseminf, fsolve, lsqcurvefit,lsqnonlin | |||
fmincon, fminunc,fsolve, lsqcurvefit, lsqlin,lsqnonlin, quadprog | |||
Use goal attainment/minimax merit function (multiobjective) vs. fmincon (single objective). | |||
Choose Levenberg-Marquardt or Gauss-Newton over the trust-region dogleg algorithm. | |||
fmincon, fminunc,fsolve, lsqcurvefit, lsqlin,lsqnonlin, quadprog | |||
fgoalattain, fmincon,fminimax, fminsearch,fminunc, fseminf, fsolve,linprog (large-scale only),lsqcurvefit, lsqlin (large-scale only), lsqnonlin,quadprog (large-scale only) | |||
fmincon, fminunc,fsolve, lsqcurvefit, lsqlin,lsqnonlin, quadprog | |||
All functions except the medium-scale algorithms forlinprog, lsqlin, and quadprog | |||
Typical x values. The length of the vector is equal to the number of elements in x0, the starting point. | fmincon, fminunc,fsolve, lsqcurvefit, lsqlin,lsqnonlin, quadprog |
Examples
options = optimset('Display','iter','TolFun',1e-8)
This statement makes a copy of the options structure called options, changing the value of the TolX parameter and storing new values in optnew.
· optnew = optimset(options,'TolX',1e-4);
This statement returns an optimization options structure that contains all the parameter names and default values relevant to the function fminbnd.