The function trustsolve.m solves generic systems of nonlinear equations using a globally convergent trust-region method. The ancillary functions dogleg.m and steighaug.m solve the trust-region problem using respectively the Dogleg and CG-Steighaug methods. The Steighaug approach is marginally slower but often more robust. Finally, the ancillary function jabob1.m computes the Jacobian using numerical differentiation.