function [sample] = rsample(population,nsamples)
sample = zeros(length(nsamples),size(population,2));
rindex = randi([1 length(population)],nsamples,1);
for i=1:length(rindex)
    sample(i,:) = population(rindex(i),:);
end
