write code to set convergence criteria jacobian in matlab

main.m
options = optimoptions(@fsolve,'SpecifyObjectiveGradient',true,'CheckGradients',true);
options.StepTolerance = 1e-6;
options.FunctionTolerance = 1e-6;
options.OptimalityTolerance = 1e-6;

syms x y
F = [x^2 + y^2 - 1; x^2 - y^2];
J = jacobian(F, [x, y]);

[x_sol, fval, exitflag] = fsolve(F, [0.5, 0], options);
311 chars
11 lines

gistlibby LogSnag