function rSamples = genSamples(cb, pr, numSamples)

global MINF;
global MAXF;

N = size(cb, 2); % number of neurons

rSamples = zeros(numSamples,N);

for i=1:numSamples
    sym = max(find(rand > pdf2cpd(pr)));
    foundR = 1;
    while foundR
        newR = poissrnd(cb(sym,:));
        newR = max(newR,MINF);
        newR = min(newR,MAXF);
        foundR = 0;
        for j=1:i-1 if prod(newR == rSamples(j,:)) foundR = 1; end; end
    end
    rSamples(i,:) = newR;
   % fprintf('sym %d, R: %d %d (%.2f %.2f)\n',sym,newR,cb(sym,:));
end


