function y = cross_valid_set(n,k)
%VALID_SET   Create the k-fold cross-validation sets.

l=randperm(n);

for i=1:floor(n/k)
    
    y{i}=l((1+k*(i-1)):k*i);
    
end

y{floor(n/k)+1}=l((1+k*floor(n/k)):n);