No BSD License  

Highlights from
Sampling from multivariate correlated binary and poisson random variables

from Sampling from multivariate correlated binary and poisson random variables by Philipp Berens
These Matlab functions can be used to generate multivariate correlated binary variables, and correl

countElem(x,sv,ev)
function c = countElem(x,sv,ev)

% c = countElem(x,sv,ev)
%  counts the occurences for each value in [sv,ev)
%
% Code from the paper: 'Generating spike-trains with specified
% correlations', Macke et al., submitted to Neural Computation
%
% www.kyb.mpg.de/bethgegroup/code/efficientsampling


if nargin<2
    sv=0;ev=max(x);
end

c =histc(x,sv:ev-1);

Contact us at files@mathworks.com