The example that can be found at the documentation page generated by the command:
web([docroot '/toolbox/optim/tutoria7.html'])
states that the following commands:
x0 = [-1,1]; % Starting guess
options = optimset('LargeScale','off');[x,fval,exitflag,output] = fminunc(@objfun,x0,options);
produce the solution:
x = 0.5000 -1.0000 ...
However, I actually obtain the output:
Optimization terminated: relative infinity-norm of gradient less than options.TolFun.
Best Answer