% Makes a rasterplot of a collection of spike trains % P should contain the spike trains in binary format % with each row being a spike train % easy_rasterplot(P,dt); % You might use it as follows: % P=sip(.2,.5,2,100,.1); % easy_rasterplot(P,.1); function easy_rasterplot(P,dt) % Get the number of spike trains (N) % and the size (in bins) of each train (T) [N T]=size(P); % Fill in s to the format required by rasterplot.m s=[]; for i=1:N s=[s (i-1)*T+find(P(i,:))]; end % Change s and T to the correct dimensions s=s*dt; T=T*dt; rasterplot(s,N,T);