GetSessionInfo.m 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. function [Rat, Type, Day, TetrodeNumber, ClusterNumber, Session, Sessiontype, Index1] = GetSessionInfo(name)
  2. a=strfind(name,'-');
  3. b=strfind(name,'Main');
  4. c=strfind(name,'.');
  5. if ~isempty(b)
  6. Rat=name(a(1)+1:a(2)-1);
  7. Type='Main';
  8. Day=name(a(2)+5:a(3)-1);
  9. TetrodeNumber=name(a(3)+3:a(4)-1);
  10. ClusterNumber=name(a(4)+2:c(1)-1);
  11. else
  12. Rat=name(a(1)+1:a(2)-1);
  13. Type='Pilot';
  14. Day=name(a(2)+6:a(3)-1);
  15. TetrodeNumber=name(a(3)+3:a(4)-1);
  16. ClusterNumber=name(a(4)+2:c(1)-1);
  17. end
  18. if str2num(Rat)==448 || str2num(Rat) == 459 || str2num(Rat) == 463
  19. if str2num(Day)==3
  20. Session='Alternation';
  21. Sessiontype='SS';
  22. Index1=1;
  23. elseif str2num(Day)==4
  24. Session='Alternation';
  25. Sessiontype='SSCH1';
  26. Index1=2;
  27. elseif str2num(Day)==5
  28. Session='Alternation';
  29. Sessiontype='SSCH2';
  30. Index1=3;
  31. elseif str2num(Day)==6
  32. Session='Alternation';
  33. Sessiontype='FRCH1';
  34. Index1=4;
  35. elseif str2num(Day)==7
  36. Session='Alternation';
  37. Sessiontype='FRCH2';
  38. Index1=5;
  39. elseif str2num(Day)==8
  40. Session='Alternation';
  41. Sessiontype='SSFR1';
  42. Index1=6;
  43. elseif str2num(Day)==9
  44. Session='Alternation';
  45. Sessiontype='SSFR2';
  46. Index1=7;
  47. elseif str2num(Day)==10
  48. Session='Tmaze';
  49. Sessiontype='T-SSCH1';
  50. Index1=14;
  51. elseif str2num(Day)==11
  52. Session='Tmaze';
  53. Sessiontype='T-SSCH2';
  54. Index1=15;
  55. elseif str2num(Day)==12
  56. Session='Tmaze';
  57. Sessiontype='T-Quantity1';
  58. Index1=16;
  59. elseif str2num(Day)==13
  60. Session='Tmaze';
  61. Sessiontype='T-Quantity2';
  62. Index1=17;
  63. elseif str2num(Day)==14
  64. Session='Alternation';
  65. Sessiontype='Quantity1';
  66. Index1=8;
  67. elseif str2num(Day)==15
  68. Session='Alternation';
  69. Sessiontype='Quantity2';
  70. Index1=9;
  71. end
  72. elseif str2num(Rat)==473 || str2num(Rat) == 488
  73. if str2num(Day)==1
  74. Session='Alternation';
  75. Sessiontype='SS';
  76. Index1=1;
  77. elseif str2num(Day)==2
  78. Session='Alternation';
  79. Sessiontype='SSCH1';
  80. Index1=2;
  81. elseif str2num(Day)==3
  82. Session='Alternation';
  83. Sessiontype='SSCH2';
  84. Index1=3;
  85. elseif str2num(Day)==4
  86. Session='Alternation';
  87. Sessiontype='FRCH1';
  88. Index1=4;
  89. elseif str2num(Day)==5
  90. Session='Alternation';
  91. Sessiontype='FRCH2';
  92. Index1=5;
  93. elseif str2num(Day)==6
  94. Session='Alternation';
  95. Sessiontype='SSFR1';
  96. Index1=6;
  97. elseif str2num(Day)==7
  98. Session='Alternation';
  99. Sessiontype='SSFR2';
  100. Index1=7;
  101. elseif str2num(Day)==8
  102. Session='Tmaze';
  103. Sessiontype='T-SSCH1';
  104. Index1=14;
  105. elseif str2num(Day)==9
  106. Session='Tmaze';
  107. Sessiontype='T-SSCH2';
  108. Index1=15;
  109. elseif str2num(Day)==10
  110. Session='Tmaze';
  111. Sessiontype='T-Quantity1';
  112. Index1=16;
  113. elseif str2num(Day)==11
  114. Session='Tmaze';
  115. Sessiontype='T-Quantity2';
  116. Index1=17;
  117. elseif str2num(Day)==12
  118. Session='Alternation';
  119. Sessiontype='Quantity1';
  120. Index1=8;
  121. elseif str2num(Day)==13
  122. Session='Alternation';
  123. Sessiontype='Quantity2';
  124. Index1=9;
  125. elseif str2num(Day)==14
  126. Session='Alternation';
  127. Sessiontype='SSFRCH1';
  128. Index1=10;
  129. elseif str2num(Day)==15
  130. Session='Alternation';
  131. Sessiontype='SSFRCH2';
  132. Index1=11;
  133. elseif str2num(Day)==16
  134. Session='Alternation';
  135. Sessiontype='Object1';
  136. Index1=12;
  137. elseif str2num(Day)==17
  138. Session='Alternation';
  139. Sessiontype='Object2';
  140. Index1=13;
  141. end
  142. elseif str2num(Rat)==509
  143. if isequal(Type,'Pilot')
  144. Session='Alternation';
  145. Sessiontype='SS';
  146. Index1=1;
  147. else
  148. if str2num(Day)==1
  149. Session='Alternation';
  150. Sessiontype='SS';
  151. Index1=1;
  152. elseif str2num(Day)==2
  153. Session='Alternation';
  154. Sessiontype='SSCH1';
  155. Index1=2;
  156. elseif str2num(Day)==3
  157. Session='Alternation';
  158. Sessiontype='SSCH2';
  159. Index1=3;
  160. elseif str2num(Day)==4
  161. Session='Alternation';
  162. Sessiontype='FRCH1';
  163. Index1=4;
  164. elseif str2num(Day)==5
  165. Session='Alternation';
  166. Sessiontype='FRCH2';
  167. Index1=5;
  168. elseif str2num(Day)==6
  169. Session='Alternation';
  170. Sessiontype='SSFR1';
  171. Index1=6;
  172. elseif str2num(Day)==7
  173. Session='Alternation';
  174. Sessiontype='SSFR2';
  175. Index1=7;
  176. elseif str2num(Day)==8
  177. Session='Tmaze';
  178. Sessiontype='T-SSCH1';
  179. Index1=14;
  180. elseif str2num(Day)==9
  181. Session='Tmaze';
  182. Sessiontype='T-SSCH2';
  183. Index1=15;
  184. elseif str2num(Day)==10
  185. Session='Tmaze';
  186. Sessiontype='T-Quantity1';
  187. Index1=16;
  188. elseif str2num(Day)==11
  189. Session='Tmaze';
  190. Sessiontype='T-Quantity2';
  191. Index1=17;
  192. elseif str2num(Day)==12
  193. Session='Alternation';
  194. Sessiontype='Quantity1';
  195. Index1=8;
  196. elseif str2num(Day)==13
  197. Session='Alternation';
  198. Sessiontype='Quantity2';
  199. Index1=9;
  200. elseif str2num(Day)==14
  201. Session='Alternation';
  202. Sessiontype='SSFRCH1';
  203. Index1=10;
  204. elseif str2num(Day)==15
  205. Session='Alternation';
  206. Sessiontype='SSFRCH2';
  207. Index1=11;
  208. elseif str2num(Day)==16
  209. Session='Alternation';
  210. Sessiontype='Object1';
  211. Index1=12;
  212. elseif str2num(Day)==17
  213. Session='Alternation';
  214. Sessiontype='Object2';
  215. Index1=13;
  216. end
  217. end
  218. end