e_SingleUnitPavlovianAlcoholAnalysis.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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='RESULTpa.xls';
  18. load('RAWvppaALL.mat')
  19. RAW=RAWvppaALL;
  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 - this code uses a fixed bin width
  26. PStat=0.05; %for comparing pre versus post windows, or event A versus event B
  27. MinNumTrials=3;
  28. R=[];RvppaALL.Ninfo={};NN=0;Nneurons=0;
  29. BinSize=0.02;
  30. %Smoothing
  31. Smoothing=0; %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. RvppaALL.Ninfo=cat(1,RvppaALL.Ninfo,RAW(i).Ninfo);
  49. Nneurons=Nneurons+size(RAW(i).Nrast,1);
  50. end
  51. load('CoordPAall.mat');
  52. RvppaALL.Coord=CoordPAall;
  53. %RvppaALL.Coord=ones(Nneurons,4); %comment this line and uncomment the 2 lines above when you have real coordinates.
  54. RvppaALL.Structure=RvppaALL.Coord(:,4);
  55. RvppaALL.Ninfo=cat(2, RvppaALL.Ninfo, mat2cell([1:Nneurons]',ones(1,Nneurons),1));
  56. RvppaALL.Erefnames= Erefnames;
  57. RvppaALL.Rat(1:Nneurons,1)=NaN;
  58. RvppaALL.Session(1:Nneurons,1)=NaN;
  59. for i=1:length(RvppaALL.Ninfo)
  60. RvppaALL.Rat(i,1)=str2num(RvppaALL.Ninfo{i,1}(3:5));
  61. RvppaALL.Session(i,1)=str2num(RvppaALL.Ninfo{i,1}(10:11));
  62. end
  63. % preallocating
  64. RvppaALL.Param.Tm=Tm;
  65. RvppaALL.Param.Tbin=Tbin;
  66. RvppaALL.Param.Dura=Dura;
  67. RvppaALL.Param.Baseline=Baseline;
  68. RvppaALL.Param.PStat=PStat;
  69. RvppaALL.Param.MinNumTrials=MinNumTrials;
  70. RvppaALL.Param.path=path;
  71. RvppaALL.Param.prewin=prewin;
  72. RvppaALL.Param.postwin=postwin;
  73. RvppaALL.Param.BLwin=BLWin;
  74. RvppaALL.Param.RespWin=RespWin;
  75. RvppaALL.Param.ResponseReq=WINin;
  76. RvppaALL.Param.SmoothTYPE=SmoothTYPE;
  77. RvppaALL.Param.SmoothSPAN=SmoothSPAN;
  78. for k=1:length(Erefnames)
  79. RvppaALL.Ev(k).PSTHraw(1:Nneurons,1:length(Tm))=NaN(Nneurons,length(Tm));
  80. RvppaALL.Ev(k).PSTHz(1:Nneurons,1:length(Tm))=NaN(Nneurons,length(Tm));
  81. RvppaALL.Ev(k).Meanraw(1:Nneurons,1)=NaN;
  82. RvppaALL.Ev(k).Meanz(1:Nneurons,1)=NaN;
  83. RvppaALL.Ev(k).BW(1:Nneurons,1)=NaN;
  84. RvppaALL.Ev(k).ttest(1:Nneurons,1)=NaN;
  85. RvppaALL.Ev(k).RespDir(1:Nneurons,1)=NaN;
  86. RvppaALL.Ev(k).RFLAG(1:Nneurons,1)=NaN;
  87. RvppaALL.Ev(k).CFLAG(1:Nneurons,1)=NaN;
  88. RvppaALL.Ev(k).Onsets(1:Nneurons,:)=NaN(Nneurons,2);
  89. RvppaALL.Ev(k).Offsets(1:Nneurons,:)=NaN(Nneurons,2);
  90. RvppaALL.Ev(k).NumberTrials(1:Nneurons,1)=NaN;
  91. RvppaALL.Ev(k).MaxVal(1:Nneurons,1)=NaN;
  92. RvppaALL.Ev(k).MaxTime(1:Nneurons,1)=NaN;
  93. end
  94. %% runs the main routine
  95. for i=1:length(RAW) %loops through sessions
  96. for j= 1:size(RAW(i).Nrast,1) %Number of neurons per session
  97. NN=NN+1; %neuron counter
  98. %if RvppaALL.Structure(NN)~=0 %to avoid analyzing excluded neurons
  99. for k=1:length(Erefnames) %loops thorough the events
  100. EvInd=strcmp(Erefnames(k),RAW(i).Einfo(:,2)); %find the event id number from RAW
  101. if sum(EvInd)==0
  102. fprintf('HOWDY, CANT FIND EVENTS FOR ''%s''\n',Erefnames{k});
  103. end
  104. RvppaALL.Ev(k).NumberTrials(NN,1)=length(RAW(i).Erast{EvInd});
  105. Tbase=prewin(k,1):BSIZE:prewin(k,2);
  106. if ~isempty(EvInd) && RvppaALL.Ev(k).NumberTrials(NN,1)>MinNumTrials %avoid analyzing sessions where that do not have enough trials
  107. [PSR0,N0]=MakePSR04(RAW(i).Nrast(j),RAW(i).Erast{EvInd},prewin(k,:),{1});% makes collapsed rasters for baseline.
  108. [PSR1,N1]=MakePSR04(RAW(i).Nrast(j),RAW(i).Erast{EvInd},Dura,{1});% makes collpased rasters. PSR1 is a cell(neurons)
  109. [PSR2,N2]=MakePSR04(RAW(i).Nrast(j),RAW(i).Erast{EvInd},Dura,{2});% makes trial by trail rasters. PSR1 is a cell(neurons, trials)
  110. if ~isempty(PSR0{1}) || ~isempty(PSR1{1}) %to avoid errors, added on 12/28 2011
  111. %optimal bin size
  112. % [PTH1,BW1,~]=MakePTH07(PSR1,repmat(N1, size(RAW(i).Nrast{j},1),1),{2,1});%-----DP used here
  113. % [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
  114. %Fixed bin size
  115. [PTH1,BW1,~]=MakePTH07(PSR1,repmat(N1, size(RAW(i).Nrast{j},1),1),{2,0,BinSize});%-----DP used here
  116. [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
  117. %PTH1=smooth(PTH1,SmoothSPAN,SmoothTYPE)';
  118. %PTH0=smooth(PTH0,SmoothSPAN,SmoothTYPE)';
  119. %------------- Fills the RvppaALL.Ev(k) fields --------------
  120. RvppaALL.Ev(k).BW(NN,1)=BW1;
  121. RvppaALL.Ev(k).PSTHraw(NN,1:length(Tm))=PTH1;
  122. RvppaALL.Ev(k).Meanraw(NN,1)=nanmean(RvppaALL.Ev(k).PSTHraw(NN,Tm>postwin(k,1) & Tm<postwin(k,2)),2);
  123. if sum(PTH0,2)~=0
  124. RvppaALL.Ev(k).PSTHz(NN,1:length(Tm))=normalize(PTH1,PTH0,0);
  125. RvppaALL.Ev(k).Meanz(NN,1)=nanmean(RvppaALL.Ev(k).PSTHz(NN,Tm>postwin(k,1) & Tm<postwin(k,2)),2);
  126. else
  127. RvppaALL.Ev(k).PSTHz(NN,1:length(Tm))=NaN(1,length(Tm));
  128. RvppaALL.Ev(k).Meanz(NN,1)=NaN;
  129. end
  130. %------------------ firing (in Hz) per trial in pre/post windows ------------------
  131. %used to make the between events comparisons and Response detection in a single window----
  132. ev(k).pre=NaN(size(RAW(i).Erast{EvInd},1),1);
  133. ev(k).post=NaN(size(RAW(i).Erast{EvInd},1),1);
  134. for m=1:size(RAW(i).Erast{EvInd},1) %loops through trials
  135. ev(k).pre(m)=sum(PSR2{m}<prewin(k,2) & PSR2{m}>prewin(k,1))/(prewin(k,2)-prewin(k,1));
  136. ev(k).post(m)=sum(PSR2{m}<postwin(k,2) & PSR2{m}>postwin(k,1))/(postwin(k,2)-postwin(k,1));
  137. end
  138. %---------------------------Response detection w/ SignRank on pre/post windows---------------------------
  139. [~,RvppaALL.Ev(k).ttest(NN,1)]=ttest(ev(k).pre, ev(k).post); %Signrank used here because it is a dependant sample test
  140. if RvppaALL.Ev(k).ttest(NN,1)<PStat
  141. RvppaALL.Ev(k).RespDir(NN,1)=sign(mean(ev(k).post)-mean(ev(k).pre));
  142. if RvppaALL.Ev(k).RespDir(NN,1)>0
  143. Search=find(Tm>=postwin(k,1) & Tm<=postwin(k,2));
  144. [RvppaALL.Ev(k).MaxVal(NN,1),MaxInd]=max(RvppaALL.Ev(k).PSTHraw(NN,Search));
  145. RvppaALL.Ev(k).MaxTime(NN,1)=Tm(Search(1)+MaxInd-1);
  146. else
  147. Search=find(Tm>=postwin(k,1) & Tm<=postwin(k,2));
  148. [RvppaALL.Ev(k).MaxVal(NN,1),MaxInd]=min(RvppaALL.Ev(k).PSTHraw(NN,Search));
  149. RvppaALL.Ev(k).MaxTime(NN,1)=Tm(Search(1)+MaxInd-1);
  150. end
  151. else RvppaALL.Ev(k).RespDir(NN,1)=0;
  152. end
  153. %---------------------------Response detection w/ RESDETECT08 on running windows---------------------------
  154. RD=ResDetect08(PTH1,PTH0,RespWin(k,:),0,WINin, CI);
  155. RvppaALL.Ev(k).RFLAG(NN,1)=RD.RFLAG;
  156. RvppaALL.Ev(k).CFLAG(NN,1)=RD.CFLAG;
  157. RvppaALL.Ev(k).Onsets(NN,:)=RD.Onsets';
  158. RvppaALL.Ev(k).Offsets(NN,:)=RD.Offsets';
  159. RvppaALL.Param.Paramnames=RD.Paramnames;
  160. RvppaALL.Param.RDParam=RD.Params;
  161. end %if ~isempty(PSR0{1}) || ~isempty(PSR1{1})
  162. end %if EvInd=0 OR n(trials) < MinNumTrials fills with NaN
  163. end %Events
  164. %----------------------- CUES -----------------------
  165. CSPlus=strcmp('CSPlus', Erefnames);
  166. CSMinus=strcmp('CSMinus', Erefnames);
  167. if sum(CSPlus)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  168. if sum(CSPlus)~=0 & sum(CSMinus)~=0
  169. RvppaALL.CScriteria=linspace(0, max([ev(CSPlus).post(:);ev(CSMinus).post(:)]),200);%Determine the criteria range
  170. RvppaALL.CSprecriteria=linspace(0, max([ev(CSPlus).pre(:);ev(CSMinus).pre(:)]),200);%Determine the criteria range
  171. for s=1:length(RvppaALL.CScriteria);
  172. RvppaALL.CSfalsepos(NN,s)=sum(ev(CSMinus).post>=RvppaALL.CScriteria(s))/length(ev(CSMinus).post); %Determine the probability that the baseline is greater than each criteria (x)
  173. RvppaALL.CStruepos(NN,s)=sum(ev(CSPlus).post>=RvppaALL.CScriteria(s))/length(ev(CSPlus).post);%Determine the probability that the post-window firing firing is greater than critera(y)
  174. RvppaALL.CSprefalsepos(NN,s)=sum(ev(CSMinus).pre>=RvppaALL.CScriteria(s))/length(ev(CSMinus).pre); %Determine the probability that the baseline is greater than each criteria (x)
  175. RvppaALL.CSpretruepos(NN,s)=sum(ev(CSPlus).pre>=RvppaALL.CScriteria(s))/length(ev(CSPlus).pre);%Determine the probability that the pre-window firing firing is greater than critera(y)
  176. end
  177. RvppaALL.CSauROC(NN,1)=trapz(RvppaALL.CSfalsepos(NN,:),RvppaALL.CStruepos(NN,:));%Calculate area under the curve for this neuron for this event
  178. RvppaALL.CSpreauROC(NN,1)=trapz(RvppaALL.CSprefalsepos(NN,:),RvppaALL.CSpretruepos(NN,:));%Calculate area under the curve for this neuron for this event
  179. [RvppaALL.CSStat(NN,1),~]=ranksum(ev(CSPlus).post,ev(CSMinus).post); %Ranksum test used becasue it is an independant sample test
  180. else RvppaALL.CSStat(NN,1)=NaN;
  181. RvppaALL.CSauROC(NN,1)=NaN;
  182. RvppaALL.CSpreauROC(NN,1)=NaN;
  183. end
  184. end
  185. % PECSPlus=strcmp('PECSPlus', Erefnames);
  186. % PECSMinus=strcmp('PECSMinus', Erefnames);
  187. % if sum(PECSPlus)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  188. % if RvppaALL.Ev(PECSPlus).RespDir(NN,1)~=0 || RvppaALL.Ev(PECSMinus).RespDir(NN,1)~=0
  189. % [RvppaALL.PECueStat(NN,1),~]=ranksum(ev(PECSPlus).post,ev(PECSMinus).post); %Ranksum test used becasue it is an independant sample test
  190. % else RvppaALL.PECueStat(NN,1)=NaN;
  191. % end
  192. % end
  193. FirstPE=strcmp('FirstPE', Erefnames);
  194. PortEntry=strcmp('PortEntry', Erefnames);
  195. if sum(FirstPE)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  196. if RvppaALL.Ev(FirstPE).RespDir(NN,1)~=0 || RvppaALL.Ev(PortEntry).RespDir(NN,1)~=0
  197. [RvppaALL.PERewStat(NN,1),~]=ranksum(ev(FirstPE).post,ev(PortEntry).post); %Ranksum test used becasue it is an independant sample test
  198. else RvppaALL.PERewStat(NN,1)=NaN;
  199. end
  200. end
  201. % PECSMinus=strcmp('PECSMinus', Erefnames);
  202. % ITIPE=strcmp('ITIPE', Erefnames);
  203. % if sum(PECSMinus)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  204. % if RvppaALL.Ev(PECSMinus).RespDir(NN,1)~=0 || RvppaALL.Ev(ITIPE).RespDir(NN,1)~=0
  205. % [RvppaALL.PEUnrewCueStat(NN,1),~]=ranksum(ev(PECSMinus).post,ev(ITIPE).post); %Ranksum test used becasue it is an independant sample test
  206. % else RvppaALL.PEUnrewCueStat(NN,1)=NaN;
  207. % end
  208. % end
  209. CSPluswPE=strcmp('CSPluswPE', Erefnames);
  210. CSPlusnoPE=strcmp('CSPlusnoPE', Erefnames);
  211. if sum(CSPlusnoPE)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  212. if sum(CSPlusnoPE)~=0 & sum(CSPluswPE)~=0
  213. RvppaALL.CSrespcriteria=linspace(0, max([ev(CSPlusnoPE).post(:);ev(CSPluswPE).post(:)]),200);%Determine the criteria range
  214. RvppaALL.CSprerespcriteria=linspace(0, max([ev(CSPlusnoPE).pre(:);ev(CSPluswPE).pre(:)]),200);%Determine the criteria range
  215. for s=1:length(RvppaALL.CSrespcriteria);
  216. RvppaALL.CSrespfalsepos(NN,s)=sum(ev(CSPlusnoPE).post>=RvppaALL.CSrespcriteria(s))/length(ev(CSPlusnoPE).post); %Determine the probability that the baseline is greater than each criteria (x)
  217. RvppaALL.CSresptruepos(NN,s)=sum(ev(CSPluswPE).post>=RvppaALL.CSrespcriteria(s))/length(ev(CSPluswPE).post);%Determine the probability that the post-window firing firing is greater than critera(y)
  218. RvppaALL.CSprerespfalsepos(NN,s)=sum(ev(CSPlusnoPE).pre>=RvppaALL.CSrespcriteria(s))/length(ev(CSPlusnoPE).pre); %Determine the probability that the baseline is greater than each criteria (x)
  219. RvppaALL.CSpreresptruepos(NN,s)=sum(ev(CSPluswPE).pre>=RvppaALL.CSrespcriteria(s))/length(ev(CSPluswPE).pre);%Determine the probability that the post-window firing firing is greater than critera(y)
  220. end
  221. RvppaALL.CSrespauROC(NN,1)=trapz(RvppaALL.CSrespfalsepos(NN,:),RvppaALL.CSresptruepos(NN,:));%Calculate area under the curve for this neuron for this event
  222. RvppaALL.CSprerespauROC(NN,1)=trapz(RvppaALL.CSprerespfalsepos(NN,:),RvppaALL.CSpreresptruepos(NN,:));
  223. [RvppaALL.CSPlusResponseStat(NN,1),~]=ranksum(ev(CSPluswPE).post,ev(CSPlusnoPE).post); %Ranksum test used becasue it is an independant sample test
  224. else
  225. RvppaALL.CSrespcriteria=linspace(NaN,NaN,200);
  226. RvppaALL.CSrespauROC(NN,1)=NaN;
  227. RvppaALL.CSPlusResponseStat(NN,1)=NaN;
  228. RvppaALL.CSprerespauROC(NN,1)=NaN;
  229. RvppaALL.CSrespfalsepos(NN,1:length(RvppaALL.CSrespcriteria))=NaN;
  230. RvppaALL.CSrespfalsepos(NN,1:length(RvppaALL.CSrespcriteria))=NaN;
  231. fprintf('NAN! Neuron ID # %d\n',NN);
  232. end
  233. else
  234. RvppaALL.CSrespcriteria=linspace(NaN,NaN,200);
  235. RvppaALL.CSrespauROC(NN,1)=NaN;
  236. RvppaALL.CSPlusResponseStat(NN,1)=NaN;
  237. RvppaALL.CSprerespauROC(NN,1)=NaN;
  238. RvppaALL.CSrespfalsepos(NN,1:length(RvppaALL.CSrespcriteria))=NaN
  239. RvppaALL.CSrespfalsepos(NN,1:length(RvppaALL.CSrespcriteria))=NaN;
  240. fprintf('NAN! Neuron ID # %d\n',NN);
  241. end
  242. %
  243. CSMinuswPE=strcmp('CSMinuswPE', Erefnames);
  244. CSMinusnoPE=strcmp('CSMinusnoPE', Erefnames);
  245. % if sum(CSMinuswPE)~=0 %To avoid this analysis is Go and NoGo cues are not included in the analysis
  246. % if RvppaALL.Ev(CSMinuswPE).RespDir(NN,1)~=0 || RvppaALL.Ev(CSMinusnoPE).RespDir(NN,1)~=0
  247. % [RvppaALL.CSMinusResponseStat(NN,1),~]=ranksum(ev(CSMinuswPE).post,ev(CSMinusnoPE).post); %Ranksum test used becasue it is an independant sample test
  248. % else RvppaALL.CSMinusResponseStat(NN,1)=NaN;
  249. % end
  250. % end
  251. %
  252. RvppaALL.CSPlusRatio(NN,1)=RvppaALL.Ev(3).NumberTrials(NN)/length(ev(CSPlus).post);
  253. RvppaALL.CSMinusRatio(NN,1)=RvppaALL.Ev(5).NumberTrials(NN)/length(ev(CSMinus).post);
  254. fprintf('Neuron ID # %d\n',NN);
  255. %elseif RvppaALL.Structure(NN)~=0
  256. %end %exclusion: IF RvppaALL.Structure(NN)~=0 to avoid analyzing excluded neurons
  257. end %neurons: FOR j= 1:size(RAW(i).Nrast,1)
  258. end %sessions: FOR i=1:length(RAW)
  259. RvppaALL.CSfalseposMEAN(1,:)=nanmean(RvppaALL.CSfalsepos(RvppaALL.Structure==10,:));
  260. RvppaALL.CSfalseposSEM(1,:)=nanste(RvppaALL.CSfalsepos(RvppaALL.Structure==10,:),1);
  261. RvppaALL.CStrueposMEAN(1,:)=nanmean(RvppaALL.CStruepos(RvppaALL.Structure==10,:));
  262. RvppaALL.CStrueposSEM(1,:)=nanste(RvppaALL.CStruepos(RvppaALL.Structure==10,:),1);
  263. RvppaALL.CSrespfalseposMEAN(1,:)=nanmean(RvppaALL.CSrespfalsepos(RvppaALL.Structure==10,:));
  264. RvppaALL.CSrespfalseposSEM(1,:)=nanste(RvppaALL.CSrespfalsepos(RvppaALL.Structure==10,:),1);
  265. RvppaALL.CSresptrueposMEAN(1,:)=nanmean(RvppaALL.CSresptruepos(RvppaALL.Structure==10,:));
  266. RvppaALL.CSresptrueposSEM(1,:)=nanste(RvppaALL.CSresptruepos(RvppaALL.Structure==10,:),1);
  267. if SAVE_FLAG
  268. save('RvppaALL.mat','RvppaALL')
  269. end
  270. toc