
function [f, gf] = obj3(x)

x1 = x(1); x2 = x(2);

f = (x1-10)^3 + (x2-20)^3;
% Compute gradient of objective function
% nargin and nargout indicate how many input or output arguments, respectively, a user has supplied
if nargout > 1
gf(1,1) = 3*(x1-10)^2;
gf(2,1) = 3*(x2-20)^2;
end