Create options struct for optimization functions.
optimset('parameter', value, ...); %设置所有参数及其值,未设置的为默认值 optimset(optimfun); %设置与最优化函数有关的参数为默认 optimset(old, 'parmeter', 'value', ... ); %复制已有的设置,并修改特定项 optimset(old, new); %两项合并
GradObj
When set to "on", the function to be minimized must return a second argument which is the gradient, or first derivative, of the function at the point X. If set to "off" [default], the gradient is computed via finite differences.
MaxIter
Maximum number of algorithm iterations before optimization stops. Must be a positive integer.