function [PSRout, Nout]=MakePSR0int(Nrast,EintS,EintE,PRMS,Int) %Eint is the interval start and end %PRMS=2 give a PSR cell {neurons,trials} and PRMS=1 collapses all the trials > %cell{neurons,1} %N is the number of interval %Int: 1=iti. 2=trial inttype=Int{1}; if inttype==1 Timeshift=10; elseif inttype==2 Timeshift=0; end Otype=PRMS{1}; FLAG=0; if length(PRMS)>1 FLAG=1; end if Otype==1 PSRout=cell(size(Nrast,1),1); for i=1:length(Nrast) for k=1:size(EintS,1) if FLAG==0 tmp=Nrast{i}; PSRout{i}=cat(1,PSRout{i},tmp(tmp>EintS(k,1)+Timeshift & tmpEintS(k,1)+Timeshift & tmpEintS(k,1) & tmpEintS(k,1)+Timeshift & tmpEintS(k,1)+Timeshift & tmp