Watch this Author's files
Sorry John, sorted out the problem, was my fault... thanks again for these useful codes.
I tried to run the Rosenbrock example included in the help of your routine hessian, i.e. I ran
rosen = @(x) (1-x(1)).^2 + 105*(x(2)-x(1).^2).^2;
[h,err] = hessian(rosen,[1 1])
I get the following error:
"??? Error using ==> subsindex
Function 'subsindex' is not defined for values of class 'function_handle'."
do you know how to solve this?