function [PSRout Nout]=MakePSR04(Nrast,Erast,Win) %Win is the time window around the event %N is the number of trials PSRout(1:size(Nrast,1),1)=NaN; for k=1:size(Erast,1) %loops through the trials ref event for i=1:length(Nrast) %loops through all lever presses tmp=Nrast(i)-Erast(k); if ~isempty(find(tmp>Win(1) & tmpWin(1) & tmp