MakePSRlever.m 443 B

123456789101112
  1. function [PSRout Nout]=MakePSR04(Nrast,Erast,Win)
  2. %Win is the time window around the event
  3. %N is the number of trials
  4. PSRout(1:size(Nrast,1),1)=NaN;
  5. for k=1:size(Erast,1) %loops through the trials ref event
  6. for i=1:length(Nrast) %loops through all lever presses
  7. tmp=Nrast(i)-Erast(k);
  8. if ~isempty(find(tmp>Win(1) & tmp<Win(2), 1))
  9. PSRout(i,1)=tmp(tmp>Win(1) & tmp<Win(2));
  10. end
  11. end
  12. end