function z = S(x)
  %x : N x 10 matrix of decision variables
   N = size(x,1); % number of samples
 c=[-6.089 -17.164 -34.054 -5.914 -24.721 -14.986 -24.100 -10.708 -26.662 ...
	-22.179];
 for i=1:N
   z(i) =  sum(exp(x(i,:)).*(c+(x(i,:)-log(sum(exp(x(i,:)))))));
 end