Source code

% Function evaluation% (N.B., MATLAB optimization toolbox 2nd output is gradient,% instead of 2nd output being a dummy constraint vector like this one.)
type fHaftka4p2p1% Gradient evaluation% (N.B., MATLAB optimization toolbox has separate function% for nonlinear constraints and their gradients instead of% a second function for gradients of objective and constraints% like this one, which has a dummy constraint for use with SQP.)
type gHaftka4p2p1