Step 2:Invoke one of the unconstrained optimization routines xO [-1,1];Starting guess ·options optimset('LargeScale','off); [x,fval,exitflag,output] fminunc(@objfun,x0,options);
Step 2: Invoke one of the unconstrained optimization routines • x0 = [-1,1]; % Starting guess • options = optimset('LargeScale','off'); • [x,fval,exitflag,output] = fminunc(@objfun,x0,options);
After 40 function evaluations,this produces the solution X= 0.5000-1.0000 The function at the solution x is returned in fval. fval 1.3030e-10 The exitflag tells if the algorithm converged.An exitflag 0 means a local minimum was found. exitflag 1
• After 40 function evaluations, this produces the solution x = 0.5000 -1.0000 • The function at the solution x is returned in fval. fval = 1.3030e-10 • The exitflag tells if the algorithm converged. An exitflag > 0 means a local minimum was found. exitflag = 1