0001
0002
0003 eegpath = 'D:\data_emse\ptsdpet\link14hz\'; cd(eegpath);
0004 ext = '_link14hz';
0005 groups = {'c' 'p'};
0006 cond = {'tac' 'oac'};
0007
0008 subs = [1:10];
0009
0010
0011 sample_rate = 2.5;
0012 epoch_start = -200;
0013 epoch_end = 1500;
0014 points = 681;
0015 timeArray = meshgrid(epoch_start:sample_rate:epoch_end,1)';
0016 timeNonZero = find(timeArray);
0017 timeZero = find(timeArray == 0);
0018
0019 for g = 1:length(groups),
0020 for i=1:length(subs),
0021 for c=1:length(cond),
0022
0023
0024 file = sprintf('%s%s%02d%s%s.txt',eegpath,groups{g},subs(i),cond{c},ext);
0025 data = sprintf( '%s%02d%s%s', groups{g},subs(i),cond{c},ext);
0026 if ~exist(data,'var')
0027 fprintf('loading %s\n',file);
0028 load(file);
0029
0030
0031 volt = eval(data);
0032 InterpZero = interp1( timeArray(timeNonZero), volt, 0, 'cubic' );
0033 volt = [volt(1:timeZero-1,:); InterpZero; volt(timeZero:end,:)];
0034 eval(strcat(data,' = volt;'))
0035
0036 else
0037
0038
0039
0040 end
0041 end
0042 end
0043 end
0044
0045 clear g i c file data timeNonZero volt InterpZero