function varargout = obje(x,mode) global numf numg numH argout = 0; f1 = -13+x(1)-2*x(2)+5*x(2)^2-x(2)^3; f2 = -29+x(1)-14*x(2)+x(2)^2+x(2)^3; if bitand(mode,1) numf = numf + 1; argout = argout + 1; varargout(argout) = {f1^2 + f2^2}; end g1 = -2 + 10*x(2) - 3*x(2)^2; g2 = -14 + 2*x(2) + 3*x(2)^2; if bitand(mode,2) numg = numg + 1; argout = argout + 1; varargout(argout) = {2*[f1 + f2; f1*g1 + f2*g2]}; end if bitand(mode,4) numH = numH + 1; argout = argout + 1; varargout(argout) = {2*[2 (-16 + 12*x(2)); (-16+12*x(2)) f1*(10-6*x(2))+g1^2+f2*(2+6*x(2))+g2^2]}; end return;