function [f,g,h] = f6(x) f = x(1)^4+2*x(2)^4+-3*x(3)^2; if nargout > 1 g = [4*x(1)^3, 8*x(2)^3,-6*x(3)]'; end; if nargout > 2 h = [12*x(1)^2 0 0; 0 24*x(2)^2 0; 0 0 -6]; end;