<div dir="ltr"><div><br></div>Dear Dwight,<div><br></div><div>CDA should be pretty robust, did you try to first look at </div><div>single-subject ERPs? It may give you a clue to why you</div><div>don't observe a regular CDA.</div>
<div><br></div><div>Unfortunately, I do not know ERPlab, so the syntax of</div><div>your code does not tell me much, but plotting ERPs for</div><div style>your subjects is pretty easy to do either in matlab or</div><div style>
through EEGlab gui. </div><div style><br></div><div style>You can for example try the following code:</div><div style><br></div><div style>% I assume that all your events are in EEGlab, and </div><div style>% all are signalling the onset of the stimulus that has</div>
<div style>% to be held in memory, and that the last character</div><div style>% of event type is either 'l' or 'r' corresponding to the</div><div style>% attended hemifield.</div><div style>% I also assume that the data are epoched.</div>
<div style>% If these assumptions are wrong, tell me :)</div><div style><br></div><div style>% looking for left and right attended stimuli:</div><div><div style>types = {EEG.event.type};</div><div style>hemif = cellfun(@(x) x(end), types, 'UniformOutput', false);</div>
<div style><br></div><div style>lefthem = strcmp('l', hemif);</div><div style>righthem = strcmp('r', hemif);</div><div style><br></div><div style>% now we will be filling a matrix with relevant epochs</div>
<div style>% for example: if left hemifield --> right electrode</div><div style>% below, the electrodes vector has the form:</div><div style>% electrodes = [left_electrode, right_electrode];</div><div style>% so you have to change electrode numbers</div>
<div style>% to the electrodes you want to compare </div><div style><br></div><div style>electrodes = [2, 3];<br></div><div style><br></div><div style>len = sum([lefthem, righthem]);</div><div style><br></div><div style>ERPs_contra = zeros(len, EEG.pnts);</div>
<div style>ERPs_ipsi = zeros(len, EEG.pnts);<br></div><div style><br></div><div style>% left hemifield --> right electrode:</div><div style>lenl = sum(lefthem);</div><div style>ERPs_contra(1:lenl, :) = squeeze(EEG.data(electrodes(2), :, lefthem))';</div>
<div style>EPRs_ipsi(1:lenl, :) = squeeze(EEG.data(electrodes(1), :, lefthem))';</div><div style><br></div><div style>%  right hemifield --> left electrode:</div><div style>ERPs_contra(lenl+1:end, :) = squeeze(EEG.data(electrodes(1), :, righthem))';</div>
<div style>ERPs_ipsi(lenl+1:end, :) = squeeze(EEG.data(electrodes(2), :, righthem))';</div><div style><br></div><div style>% plotting:</div><div style>plot(EEG.times, mean(ERPs_contra), 'LineWidth', 1.5, 'Color', [0.3, 0.3, 0.3]);</div>
<div style>hold on;</div><div style>plot(EEG.times, mean(ERPs_ipsi), 'LineWidth', 1.5, 'Color', [0.7, 0.7, 0.7]);<br></div><div style>title(EEG.setname); legend('contralateral', 'ipsilateral');</div>
<div style><br></div><div style>% END of CODE</div><div style><br></div><div style><br></div><div style>Let me know if this helps.</div><div style>This can also be augmented with a loop that</div><div style>goes through all the subjects, so that you don't</div>
<div style>have to load subjects manually.</div><div><br clear="all"><div>Good Luck!<br>Mikolaj Magnuski</div>
</div></div></div>