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