[Eeglablist] Saving/exporting ERPs and difference waves

Bradley Voytek semiconscious at gmail.com
Tue Sep 25 11:01:45 PDT 2007


Jane:

You can use the EEGLAB command history to your advantage a bit here.

If you use the EEGLAB GUI and go to plot > sum/compare ERPs, and run
your comparison, you can then get the command history using ALLCOM. To
retrieve your most recent comparison, right after you run it, use
ALLCOM{1}.

Here's a snippit of code used to call the function to plot difference
waves comparing datasets 1 & 2 to 3 & 4, looking at electrodes 1:64,
with a 10Hz LPF for display:

pop_comperp(ALLEEG, 1, [1 2] , [3 4] , 'addavg', 'on', 'addstd',
'off', 'subavg', 'on', 'diffavg', 'on', 'diffstd', 'off', 'chans',
[1:64] , 'lowpass',10, 'tplotopt',{ 'ydir',-1});

Now, if you want to extract the waveform for the averages for the two
groups, as well as that for the difference wave, all you have to do is
add the following snippit of code to the front of that:

[erp1 erp2 erpsub] =

Your datasets to average will be erp1, your datasets to average and
then subtract will be erp2, and your difference wave will be erpsub.
Each will be of size (# of electrodes) * (# of data points in epoch)

Just run your sum/compare, grab the code using ALLCOM{1}, then add
"[erp1 erp2 erpsub] = " (without the quotes) in front of whatever
ALLCOM{1} gives you.

That's the easiest way.

Good luck!

::brad

--
Bradley Voytek
PhD Candidate: Neuroscience
Helen Wills Neuroscience Institute
University of California, Berkeley
132 Barker Hall
Berkeley, CA 94720-3190

btvoytek at berkeley.edu
213.840.4560 (cell)



More information about the eeglablist mailing list