You are free to edit the source code of the 'trust-region-reflective' or 'active-set' fmincon algorithms, though not the 'interior-point' or 'sqp' algorithms. If you edit the source, I suggest that you first copy it to a different file so that you don't overwrite your original MATLAB code.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Best Answer