function [J,x_] = test_fcn(x, fcnName)
%% ------------------------------------------
%---- SPHERE --------------------------------
% -------------------------------------------
if strcmp(fcnName,'sphere')
    J = 1;
    x_ = zeros(1,size(x,2));
    for i=1:size(x,2)
        % quadratic cost function
        J = J + (x(:,i)-x_(i)).^(2);
    end
end

