I use this from the documentation:
options = optimoptions(\'fminunc\',\'GradObj\',\'on\',\'Hessian\',\'on\');
and for some reason I get this er
The function optimoptions was newly introduced in MATLAB R2013a. It might be the case that you are using an older version of MATLAB. If so use optimset instead of optimoptions.
optimoptions
MATLAB R2013a
MATLAB
optimset