j_SingleUnitPavlovianAlcoholExposedAnalysis.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. %%
  2. % Sept 26th, 2012: Added line 278. Now excludes Baseline calculations on excluded neurons
  3. % May 21st, 2012: Added the time of the max(PSTH) and the max for signigicant responses
  4. % May 15th, 2012: this version includes waveform analysis
  5. % May 9th, 2012: The baseline used to compute z-scores is matched with the prewindow matrix
  6. % May 9th, 2012: R.Erefnames added to avoid having to fetch it from the excel file
  7. % May 2nd, 2012: this version uses parametric tests (ttest/ttest2 instead of SignRank and Ranksum)
  8. % April 27th, 2012:
  9. % -handles both GoNoGo and 2Go exps
  10. % -uses the new cleaned-up ResDetectSignRank02 code
  11. % April 13th, 2012:
  12. % -uses a different way of excluding neurons (it skips the excluded neurons instead of filtering then afterwards
  13. % -R.Structure added that stores the brain region (DMS, CORE, SHELL)
  14. clear all; clc;
  15. global Dura Baseline Tm Tbase BSIZE Tbin
  16. tic
  17. path='RESULTpas.xls';
  18. load('RAWvppasALL.mat')
  19. RAW=RAWvppasALL;
  20. %Main settings
  21. SAVE_FLAG=1;
  22. BSIZE=0.01; %Do not change
  23. Dura=[-22 20]; Tm=Dura(1):BSIZE:Dura(2);
  24. %Baseline=[-22 0]; Tbase=Baseline(1):BSIZE:Baseline(2); %now defined line 98
  25. Tbin=-0.5:0.005:0.5; %window used to determine the optimal binsize
  26. PStat=0.05; %for comparing pre versus post windows, or event A versus event B
  27. MinNumTrials=1;
  28. RvppasALL=[];RvppasALL.Ninfo={};NN=0;Nneurons=0;
  29. BinSize=0.02;
  30. %Smoothing
  31. Smoothing=1; %0 for raw and 1 for smoothing
  32. SmoothTYPE='lowess';
  33. SmoothSPAN=5;
  34. if Smoothing~=1, SmoothTYPE='NoSmoothing';SmoothSPAN=NaN; end
  35. % List of events to analyze and analysis windows EXTRACTED from excel file
  36. [~,Erefnames]=xlsread(path,'Windows','a3:a12'); % cell that contains the event names
  37. prewin = xlsread(path,'Windows','b3:c12');
  38. postwin = xlsread(path,'Windows','d3:e12');
  39. BLWin= xlsread(path,'Windows','f3:g12');
  40. RespWin= xlsread(path,'Windows','h3:i12');
  41. %Settings for Response detection w/ signrank
  42. WINin=[0.03,0.3]; %Onset and offset requirements in sec.
  43. %WINin=[-2 -4]; %negative values define onset requirement by the number of consecutive bins and not by duration
  44. CI=[.99,.99];
  45. %%
  46. %Finds the total number of neurons accross all sessions
  47. for i=1:length(RAW)
  48. RvppasALL.Ninfo=cat(1,RvppasALL.Ninfo,RAW(i).Ninfo);
  49. Nneurons=Nneurons+size(RAW(i).Nrast,1);
  50. end
  51. % load('CoordPPSall.mat');
  52. % RPPSall.Coord=CoordPPSall;
  53. RvppasALL.Coord=10*ones(Nneurons,4); %comment this line and uncomment the 2 lines above when you have real coordinates.
  54. RvppasALL.Structure=RvppasALL.Coord(:,4);
  55. RvppasALL.Ninfo=cat(2, RvppasALL.Ninfo, mat2cell([1:Nneurons]',ones(1,Nneurons),1));
  56. RvppasALL.Erefnames= Erefnames;
  57. RvppasALL.Rat(1:Nneurons,1)=NaN;
  58. RvppasALL.Session(1:Nneurons,1)=NaN;
  59. for i=1:length(RvppasALL.Ninfo)
  60. RvppasALL.Rat(i,1)=str2num(RvppasALL.Ninfo{i,1}(4:5));
  61. RvppasALL.Session(i,1)=str2num(RvppasALL.Ninfo{i,1}(10:11));
  62. end
  63. % preallocating
  64. RvppasALL.Param.Tm=Tm;
  65. RvppasALL.Param.Tbin=Tbin;
  66. RvppasALL.Param.Dura=Dura;
  67. RvppasALL.Param.Baseline=Baseline;
  68. RvppasALL.Param.PStat=PStat;
  69. RvppasALL.Param.MinNumTrials=MinNumTrials;
  70. RvppasALL.Param.path=path;
  71. RvppasALL.Param.prewin=prewin;
  72. RvppasALL.Param.postwin=postwin;
  73. RvppasALL.Param.BLwin=BLWin;
  74. RvppasALL.Param.RespWin=RespWin;
  75. RvppasALL.Param.ResponseReq=WINin;
  76. RvppasALL.Param.SmoothTYPE=SmoothTYPE;
  77. RvppasALL.Param.SmoothSPAN=SmoothSPAN;
  78. RvppasALL.CSPlusResponseStat(1:Nneurons,1)=NaN;
  79. RvppasALL.CSStat(1:Nneurons,1)=NaN;
  80. for k=1:length(Erefnames)
  81. RvppasALL.Ev(k).PSTHraw(1:Nneurons,1:length(Tm))=NaN(Nneurons,length(Tm));
  82. RvppasALL.Ev(k).PSTHz(1:Nneurons,1:length(Tm))=NaN(Nneurons,length(Tm));
  83. RvppasALL.Ev(k).Meanraw(1:Nneurons,1)=NaN;
  84. RvppasALL.Ev(k).Meanz(1:Nneurons,1)=NaN;
  85. RvppasALL.Ev(k).BW(1:Nneurons,1)=NaN;
  86. RvppasALL.Ev(k).ttest(1:Nneurons,1)=NaN;
  87. RvppasALL.Ev(k).RespDir(1:Nneurons,1)=NaN;
  88. RvppasALL.Ev(k).RFLAG(1:Nneurons,1)=NaN;
  89. RvppasALL.Ev(k).CFLAG(1:Nneurons,1)=NaN;
  90. RvppasALL.Ev(k).Onsets(1:Nneurons,:)=NaN(Nneurons,2);
  91. RvppasALL.Ev(k).Offsets(1:Nneurons,:)=NaN(Nneurons,2);
  92. RvppasALL.Ev(k).NumberTrials(1:Nneurons,1)=NaN;
  93. RvppasALL.Ev(k).MaxVal(1:Nneurons,1)=NaN;
  94. RvppasALL.Ev(k).MaxTime(1:Nneurons,1)=NaN;
  95. end
  96. %% runs the main routine
  97. for i=1:length(RAW) %loops through sessions
  98. for j= 1:size(RAW(i).Nrast,1) %Number of neurons per session
  99. NN=NN+1; %neuron counter
  100. if RvppasALL.Structure(NN)~=0 %to avoid analyzing excluded neurons
  101. for k=1:length(Erefnames) %loops thorough the events
  102. EvInd=strcmp(Erefnames(k),RAW(i).Einfo(:,2)); %find the event id number from RAW
  103. if sum(EvInd)==0
  104. fprintf('HOWDY, CANT FIND EVENTS FOR ''%s''\n',Erefnames{k});
  105. end
  106. RvppasALL.Ev(k).NumberTrials(NN,1)=length(RAW(i).Erast{EvInd});
  107. Tbase=prewin(k,1):BSIZE:prewin(k,2);
  108. if ~isempty(EvInd) && RvppasALL.Ev(k).NumberTrials(NN,1)>=MinNumTrials %avoid analyzing sessions where that do not have enough trials
  109. [PSR0,N0]=MakePSR04(RAW(i).Nrast(j),RAW(i).Erast{EvInd},prewin(k,:),{1});% makes collapsed rasters for baseline.
  110. [PSR1,N1]=MakePSR04(RAW(i).Nrast(j),RAW(i).Erast{EvInd},Dura,{1});% makes collpased rasters. PSR1 is a cell(neurons)
  111. [PSR2,N2]=MakePSR04(RAW(i).Nrast(j),RAW(i).Erast{EvInd},Dura,{2});% makes trial by trail rasters. PSR1 is a cell(neurons, trials)
  112. if ~isempty(PSR0{1}) || ~isempty(PSR1{1}) %to avoid errors, added on 12/28 2011
  113. %optimal bin size
  114. %[PTH1,BW1,~]=MakePTH07(PSR1,repmat(N1, size(RAW(i).Nrast{j},1),1),{2,1});%-----DP used here
  115. %[PTH0,~,~]=MakePTH07(PSR0,repmat(N0, size(RAW(i).Nrast{j},1),1),{1,0,BW1});%BW1 reinjected here to make sure PTH0 & PTH1 have the same BW
  116. %Fixed bin size
  117. [PTH1,BW1,~]=MakePTH07(PSR1,repmat(N1, size(RAW(i).Nrast{j},1),1),{2,0,BinSize});%-----DP used here
  118. [PTH0,~,~]=MakePTH07(PSR0,repmat(N0, size(RAW(i).Nrast{j},1),1),{1,0,BinSize});%BW1 reinjected here to make sure PTH0 & PTH1 have the same BW
  119. PTH1=smooth(PTH1,SmoothSPAN,SmoothTYPE)';
  120. PTH0=smooth(PTH0,SmoothSPAN,SmoothTYPE)';
  121. %------------- Fills the R.Ev(k) fields --------------
  122. RvppasALL.Ev(k).BW(NN,1)=BW1;
  123. RvppasALL.Ev(k).PSTHraw(NN,1:length(Tm))=PTH1;
  124. RvppasALL.Ev(k).Meanraw(NN,1)=nanmean(RvppasALL.Ev(k).PSTHraw(NN,Tm>postwin(k,1) & Tm<postwin(k,2)),2);
  125. if sum(PTH0,2)~=0
  126. RvppasALL.Ev(k).PSTHz(NN,1:length(Tm))=normalize(PTH1,PTH0,0);
  127. RvppasALL.Ev(k).Meanz(NN,1)=nanmean(RvppasALL.Ev(k).PSTHz(NN,Tm>postwin(k,1) & Tm<postwin(k,2)),2);
  128. else
  129. RvppasALL.Ev(k).PSTHz(NN,1:length(Tm))=NaN(1,length(Tm));
  130. RvppasALL.Ev(k).Meanz(NN,1)=NaN;
  131. end
  132. %------------------ firing (in Hz) per trial in pre/post windows ------------------
  133. %used to make the between events comparisons and Response detection in a single window----
  134. ev(k).pre=NaN(size(RAW(i).Erast{EvInd},1),1);
  135. ev(k).post=NaN(size(RAW(i).Erast{EvInd},1),1);
  136. for m=1:size(RAW(i).Erast{EvInd},1) %loops through trials
  137. ev(k).pre(m)=sum(PSR2{m}<prewin(k,2) & PSR2{m}>prewin(k,1))/(prewin(k,2)-prewin(k,1));
  138. ev(k).post(m)=sum(PSR2{m}<postwin(k,2) & PSR2{m}>postwin(k,1))/(postwin(k,2)-postwin(k,1));
  139. end
  140. %---------------------------Response detection w/ SignRank on pre/post windows---------------------------
  141. [~,RvppasALL.Ev(k).ttest(NN,1)]=ttest(ev(k).pre, ev(k).post); %Signrank used here because it is a dependant sample test
  142. if RvppasALL.Ev(k).ttest(NN,1)<PStat
  143. RvppasALL.Ev(k).RespDir(NN,1)=sign(mean(ev(k).post)-mean(ev(k).pre));
  144. if RvppasALL.Ev(k).RespDir(NN,1)>0
  145. Search=find(Tm>=postwin(k,1) & Tm<=postwin(k,2));
  146. [RvppasALL.Ev(k).MaxVal(NN,1),MaxInd]=max(RvppasALL.Ev(k).PSTHraw(NN,Search));
  147. RvppasALL.Ev(k).MaxTime(NN,1)=Tm(Search(1)+MaxInd-1);
  148. else
  149. Search=find(Tm>=postwin(k,1) & Tm<=postwin(k,2));
  150. [RvppasALL.Ev(k).MaxVal(NN,1),MaxInd]=min(RvppasALL.Ev(k).PSTHraw(NN,Search));
  151. RvppasALL.Ev(k).MaxTime(NN,1)=Tm(Search(1)+MaxInd-1);
  152. end
  153. else RvppasALL.Ev(k).RespDir(NN,1)=0;
  154. end
  155. %---------------------------Response detection w/ RESDETECT08 on running windows---------------------------
  156. RD=ResDetect08(PTH1,PTH0,RespWin(k,:),0,WINin, CI);
  157. RvppasALL.Ev(k).RFLAG(NN,1)=RD.RFLAG;
  158. RvppasALL.Ev(k).CFLAG(NN,1)=RD.CFLAG;
  159. RvppasALL.Ev(k).Onsets(NN,:)=RD.Onsets';
  160. RvppasALL.Ev(k).Offsets(NN,:)=RD.Offsets';
  161. RvppasALL.Param.Paramnames=RD.Paramnames;
  162. RvppasALL.Param.RDParam=RD.Params;
  163. end %if ~isempty(PSR0{1}) || ~isempty(PSR1{1})
  164. end %if EvInd=0 OR n(trials) < MinNumTrials fills with NaN
  165. end %Events
  166. %----------------------- CUES -----------------------
  167. CSPlus=strcmp('CSPlus', Erefnames);
  168. CSMinus=strcmp('CSMinus', Erefnames);
  169. if sum(CSPlus)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  170. if sum(CSMinus)~=0
  171. RvppasALL.CScriteria=linspace(0, max([ev(CSPlus).post(:);ev(CSMinus).post(:)]),200);%Determine the criteria range
  172. RvppasALL.CSprecriteria=linspace(0, max([ev(CSPlus).pre(:);ev(CSMinus).pre(:)]),200);%Determine the criteria range
  173. for s=1:length(RvppasALL.CScriteria);
  174. RvppasALL.CSfalsepos(NN,s)=sum(ev(CSMinus).post>=RvppasALL.CScriteria(s))/length(ev(CSMinus).post); %Determine the probability that the baseline is greater than each criteria (x)
  175. RvppasALL.CStruepos(NN,s)=sum(ev(CSPlus).post>=RvppasALL.CScriteria(s))/length(ev(CSPlus).post);%Determine the probability that the post-window firing firing is greater than critera(y)
  176. RvppasALL.CSprefalsepos(NN,s)=sum(ev(CSMinus).pre>=RvppasALL.CScriteria(s))/length(ev(CSMinus).pre); %Determine the probability that the baseline is greater than each criteria (x)
  177. RvppasALL.CSpretruepos(NN,s)=sum(ev(CSPlus).pre>=RvppasALL.CScriteria(s))/length(ev(CSPlus).pre);%Determine the probability that the pre-window firing firing is greater than critera(y)
  178. end
  179. RvppasALL.CSauROC(NN,1)=trapz(RvppasALL.CSfalsepos(NN,:),RvppasALL.CStruepos(NN,:));%Calculate area under the curve for this neuron for this event
  180. RvppasALL.CSpreauROC(NN,1)=trapz(RvppasALL.CSprefalsepos(NN,:),RvppasALL.CSpretruepos(NN,:));%Calculate area under the curve for this neuron for this event
  181. [~,RvppasALL.CSStat(NN,1)]=ttest2(ev(CSPlus).post,ev(CSMinus).post); %Ranksum test used becasue it is an independant sample test
  182. else RvppasALL.CSStat(NN,1)=NaN;
  183. RvppasALL.CSauROC(NN,1)=NaN;
  184. RvppasALL.CSpreauROC(NN,1)=NaN;
  185. end
  186. end
  187. PECSPlus=strcmp('PECSPlus', Erefnames);
  188. PECSMinus=strcmp('PECSMinus', Erefnames);
  189. if sum(PECSPlus)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  190. if sum(PECSMinus)~=0
  191. [RvppasALL.PECueStat(NN,1),~]=ranksum(ev(PECSPlus).post,ev(PECSMinus).post); %Ranksum test used becasue it is an independant sample test
  192. else RvppasALL.PECueStat(NN,1)=NaN;
  193. end
  194. end
  195. PECSPlus=strcmp('PECSPlus', Erefnames);
  196. ITIPE=strcmp('ITIPE', Erefnames);
  197. if sum(PECSPlus)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  198. if RvppasALL.Ev(PECSPlus).RespDir(NN,1)~=0 || RvppasALL.Ev(ITIPE).RespDir(NN,1)~=0
  199. [RvppasALL.PERewStat(NN,1),~]=ranksum(ev(PECSPlus).post,ev(ITIPE).post); %Ranksum test used becasue it is an independant sample test
  200. else RvppasALL.PERewStat(NN,1)=NaN;
  201. end
  202. end
  203. % PECSMinus=strcmp('PECSMinus', Erefnames);
  204. % ITIPE=strcmp('ITIPE', Erefnames);
  205. % if sum(PECSMinus)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  206. % if R.Ev(PECSMinus).RespDir(NN,1)~=0 || R.Ev(ITIPE).RespDir(NN,1)~=0
  207. % [R.PEUnrewCueStat(NN,1),~]=ranksum(ev(PECSMinus).post,ev(ITIPE).post); %Ranksum test used becasue it is an independant sample test
  208. % else R.PEUnrewCueStat(NN,1)=NaN;
  209. % end
  210. % end
  211. CSPluswPE=strcmp('CSPluswPE', Erefnames);
  212. CSPlusnoPE=strcmp('CSPlusnoPE', Erefnames);
  213. if sum(CSPlusnoPE)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  214. if sum(CSPluswPE)~=0
  215. RvppasALL.CSrespcriteria=linspace(0, max([ev(CSPlusnoPE).post(:);ev(CSPluswPE).post(:)]),200);%Determine the criteria range
  216. RvppasALL.CSprerespcriteria=linspace(0, max([ev(CSPlusnoPE).pre(:);ev(CSPluswPE).pre(:)]),200);%Determine the criteria range
  217. for s=1:length(RvppasALL.CSrespcriteria);
  218. RvppasALL.CSrespfalsepos(NN,s)=sum(ev(CSPlusnoPE).post>=RvppasALL.CSrespcriteria(s))/length(ev(CSPlusnoPE).post); %Determine the probability that the baseline is greater than each criteria (x)
  219. RvppasALL.CSresptruepos(NN,s)=sum(ev(CSPluswPE).post>=RvppasALL.CSrespcriteria(s))/length(ev(CSPluswPE).post);%Determine the probability that the post-window firing firing is greater than critera(y)
  220. RvppasALL.CSprerespfalsepos(NN,s)=sum(ev(CSPlusnoPE).pre>=RvppasALL.CSrespcriteria(s))/length(ev(CSPlusnoPE).pre); %Determine the probability that the baseline is greater than each criteria (x)
  221. RvppasALL.CSpreresptruepos(NN,s)=sum(ev(CSPluswPE).pre>=RvppasALL.CSrespcriteria(s))/length(ev(CSPluswPE).pre);%Determine the probability that the post-window firing firing is greater than critera(y)
  222. end
  223. RvppasALL.CSrespauROC(NN,1)=trapz(RvppasALL.CSrespfalsepos(NN,:),RvppasALL.CSresptruepos(NN,:));%Calculate area under the curve for this neuron for this event
  224. RvppasALL.CSprerespauROC(NN,1)=trapz(RvppasALL.CSprerespfalsepos(NN,:),RvppasALL.CSpreresptruepos(NN,:));
  225. [~,RvppasALL.CSPlusResponseStat(NN,1)]=ttest2(ev(CSPluswPE).post,ev(CSPlusnoPE).post); %Ranksum test used becasue it is an independant sample test
  226. else RvppasALL.CSPlusResponseStat(NN,1)=NaN;
  227. RvppasALL.CSrespauROC(NN,1)=NaN;
  228. end
  229. else
  230. RvppasALL.CSrespauROC(NN,1)=NaN;
  231. RvppasALL.CSPlusResponseStat(NN,1)=NaN;
  232. RvppasALL.CSprerespauROC(NN,1)=NaN;
  233. end
  234. %
  235. CSMinuswPE=strcmp('CSMinuswPE', Erefnames);
  236. CSMinusnoPE=strcmp('CSMinusnoPE', Erefnames);
  237. if sum(CSMinuswPE)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  238. if RvppasALL.Ev(CSMinuswPE).RespDir(NN,1)~=0 || RvppasALL.Ev(CSMinusnoPE).RespDir(NN,1)~=0
  239. [RvppasALL.CSMinusResponseStat(NN,1),~]=ranksum(ev(CSMinuswPE).post,ev(CSMinusnoPE).post); %Ranksum test used becasue it is an independant sample test
  240. else RvppasALL.CSMinusResponseStat(NN,1)=NaN;
  241. end
  242. end
  243. %
  244. RvppasALL.CSPlusRatio(NN,1)=length(ev(CSPluswPE).post)/length(ev(CSPlus).post);
  245. RvppasALL.CSMinusRatio(NN,1)=length(ev(CSMinuswPE).post)/length(ev(CSMinus).post);
  246. fprintf('Neuron ID # %d\n',NN);
  247. elseif RvppasALL.Structure(NN)~=0
  248. end %exclusion: IF R.Structure(NN)~=0 to avoid analyzing excluded neurons
  249. end %neurons: FOR j= 1:size(RAW(i).Nrast,1)
  250. end %sessions: FOR i=1:length(RAW)
  251. RvppasALL.CSfalseposMEAN(1,:)=nanmean(RvppasALL.CSfalsepos(RvppasALL.Structure==10,:));
  252. RvppasALL.CSfalseposSEM(1,:)=nanste(RvppasALL.CSfalsepos(RvppasALL.Structure==10,:),1);
  253. RvppasALL.CStrueposMEAN(1,:)=nanmean(RvppasALL.CStruepos(RvppasALL.Structure==10,:));
  254. RvppasALL.CStrueposSEM(1,:)=nanste(RvppasALL.CStruepos(RvppasALL.Structure==10,:),1);
  255. RvppasALL.CSrespfalseposMEAN(1,:)=nanmean(RvppasALL.CSrespfalsepos(RvppasALL.Structure==10,:));
  256. RvppasALL.CSrespfalseposSEM(1,:)=nanste(RvppasALL.CSrespfalsepos(RvppasALL.Structure==10,:),1);
  257. RvppasALL.CSresptrueposMEAN(1,:)=nanmean(RvppasALL.CSresptruepos(RvppasALL.Structure==10,:));
  258. RvppasALL.CSresptrueposSEM(1,:)=nanste(RvppasALL.CSresptruepos(RvppasALL.Structure==10,:),1);
  259. % RPPSall.CSprefalseposMEAN(1,:)=nanmean(RPPSall.CSprefalsepos(RPPSall.Structure==10,:));
  260. % RPPSall.CSprefalseposSEM(1,:)=nanste(RPPSall.CSprefalsepos(RPPSall.Structure==10,:),1);
  261. %
  262. % RPPSall.CSpretrueposMEAN(1,:)=nanmean(RPPSall.CSpretruepos(RPPSall.Structure==10,:));
  263. % RPPSall.CSpretrueposSEM(1,:)=nanste(RPPSall.CSpretruepos(RPPSall.Structure==10,:),1);
  264. if SAVE_FLAG
  265. save('RvppasALL.mat','RvppasALL')
  266. end
  267. toc
  268. %% Create a Summury excel spreadsheet
  269. % RESULT=[];
  270. % %RESULT=cat(2,RESULT, R.CueCorStat, R.CueCorRExtStat,R.CueIncorStat,R.CueIncorRExtStat,R.BaselineTrend, R.LExtTrend, R.BaselineLExtOne, R.BaselineLExtNo, R.DeltaLP, R.DeltaNo);
  271. %
  272. % for k=1:length(Erefnames)
  273. % RESULT=cat(2,RESULT,RPPSall.Ev(k).RespDir, RPPSall.Ev(k).RFLAG, RPPSall.Ev(k).CFLAG,RPPSall.Ev(k).Onsets, RPPSall.Ev(k).Offsets);
  274. % end
  275. %
  276. % xlswrite(path,RPPSall.Ninfo,'RESULTsheet', 'A3'); % Writes Session - Neuron - ID#
  277. % xlswrite(path,RPPSall.Structure,'RESULTsheet', 'D3'); % Writes the brain region
  278. % xlswrite(path,RESULT,'RESULTsheet', 'F3'); % Writes RESULT matrix
  279. % toc