For example, I run the following code using some specified function myfunc.m:
options = optimset('Display','Iter');x0 = [1 1];x = fminunc(@myfunc, x0, options)
This results in the display:
Directional Iteration Func-count f(x) Step-size derivative 1 2 6 1 0 Optimization terminated successfully:Search direction less than 2*options.TolXx =1.0000 1.0000
There is actually no minimum at "[1 1]" and the directional derivative is not "0". Why am I obtaining these incorrect results?
Best Answer