0001
0002
0003
0004 cd(data);
0005
0006 datapath = pwd;
0007
0008
0009 sample_rate = 2.5;
0010 epoch_start = -200;
0011 epoch_end = 1500;
0012 points = 681;
0013
0014
0015
0016 timeArray = meshgrid(epoch_start:sample_rate:epoch_end,1)';
0017 timeNonZero = find(timeArray);
0018 timeZero = find(timeArray == 0);
0019
0020
0021 for g = {'c','p'},
0022
0023 if strcmp(g,'c'),
0024 CONT.expfile = sprintf('%s%s%s%s.txt',char(g),exp,'_',data);
0025 CONT.expvolt = sprintf('%s%s%s%s', char(g),exp,'_',data);
0026 CONT.confile = sprintf('%s%s%s%s.txt',char(g),con,'_',data);
0027 CONT.convolt = sprintf('%s%s%s%s', char(g),con,'_',data);
0028
0029 CONT.diffile = sprintf('%s%s%s%s%s%s.txt',char(g),exp,'-',con,'_',data);
0030 CONT.difvolt = sprintf('%s%s%s%s%s%s', char(g),exp,'_',con,'_',data);
0031 else
0032 PTSD.expfile = sprintf('%s%s%s%s.txt',char(g),exp,'_',data);
0033 PTSD.expvolt = sprintf('%s%s%s%s', char(g),exp,'_',data);
0034 PTSD.confile = sprintf('%s%s%s%s.txt',char(g),con,'_',data);
0035 PTSD.convolt = sprintf('%s%s%s%s', char(g),con,'_',data);
0036
0037 PTSD.diffile = sprintf('%s%s%s%s%s%s.txt',char(g),exp,'-',con,'_',data);
0038 PTSD.difvolt = sprintf('%s%s%s%s%s%s', char(g),exp,'_',con,'_',data);
0039 end
0040
0041 for c = {exp,con,dif},
0042
0043 if findstr('-',char(c)),
0044 file = sprintf('%s%s%s%s%s%s.txt',char(g),exp,'-',con,'_',data);
0045 volt = sprintf('%s%s%s%s%s%s', char(g),exp,'_',con,'_',data);
0046 else
0047 file = sprintf('%s%s%s%s.txt',char(g),char(c),'_',data);
0048 volt = sprintf('%s%s%s%s', char(g),char(c),'_',data);
0049 end
0050
0051 if ~exist(volt,'var')
0052 fprintf('loading %s\n',file);
0053 load(file);
0054
0055 V = eval(volt);
0056 InterpZero = interp1( timeArray(timeNonZero), V, 0, 'cubic' );
0057 V = [V(1:timeZero-1,:); InterpZero; V(timeZero:end,:)];
0058 eval(strcat(volt,' = V;'));
0059 else
0060 fprintf('Already loaded %s\n',file);
0061 end
0062 end
0063 end
0064
0065 clear timeZero timeNonZero g c file volt V InterpZero