MATLAB: What is this mean: Gradient must be provided for trust-region algorithm

gradientincomplete gamma function.

Hi,
I have matlab code, when I run it I receive this message:
Warning: Gradient must be provided for trust-region algorithm; using line-search algorithm instead. > In fminunc at 367 In false_alarm_detection_2 at 14
Local minimum found.
Optimization completed because the size of the gradient is less than the selected value of the function tolerance.
what is that mean? and how can be solved?
Thanks

Best Answer

fmincon options describes the restrictions for the trust-region-reflective algorithm. Including Derivatives describes how you include the derivative in the objective function definition.
To avoid the warning without including a derivative, set the Algorithm option to 'interior-point' or some other algorithm:
opts = optimset('Algorithm','interior-point');
x = fmincon(objfn,x0,[],[],[],[],lb,ub,[],opts);
Take a look at the documentation examples for more information on setting gradients and options: <http://www.mathworks.com/help/optim/constrained-optimization.html>
Alan Weiss
MATLAB mathematical toolbox documentation