function  out=Rastrigin(X)

n=size(X,2);
r=[];
for i=1:n
r=[X(:,i).^2-10*cos(2*pi*X(:,i)),r];
end

out=10*n + sum(r,2);
