[Eeglablist] presenting epochs one above the other

shahar shahars10 at gmail.com
Sun May 18 15:15:19 PDT 2014


Hello Mikolaj,
Thanks for this code. I haven't check your whole code, but it looks very
good.
I have one question though: we have some data of double precision, but when
it's translated to the EEGLAB, the variable EEG.data contains data
of single precision. Does anyone have an idea why this precision has
changed ?
Thank you,

Shahar


On Sun, May 18, 2014 at 3:06 AM, Mikołaj Magnuski <imponderabilion at gmail.com
> wrote:

> The simplest (but not necessarily most efficient) way of doing this is:
>
> 1. Load the data (using pop_loadset() for example or through the GUI)
> 2. Run this script (it should work correctly assuming you have
>     more epochs than channels):
>
> %%%%%%
>
> % get size of data and allocate new data matrix
> Siz = size(EEG.data);
> NewData = zeros(fliplr(Siz));
>
> % restrucutre the data
> for i = 1:Siz(1)
>     NewData(:, :, i) = squeeze(EEG.data(i, :, :))';
> end
>
> % update relevant fields
> EEG.data = NewData;
> EEG.nbchan = Siz(3);
> EEG.trials = Siz(1);
>
> % add fake channel info:
> addchn = Siz(3) - Siz(1);
>
> for a = 1:addchn
>     num = num2str(rand(1));
>     fakename = ['ch_', num(3:5)];
>     EEG.chanlocs(Siz(1)+a) = EEG.chanlocs(Siz(1) - mod(a, Siz(1)));
>     EEG.urchanlocs(Siz(1)+a) = EEG.urchanlocs(Siz(1) - mod(a, Siz(1)));
>     EEG.chanlocs(Siz(1)+a).labels = fakename;
>     EEG.urchanlocs(Siz(1)+a).labels = fakename;
> end
>
> % trim the epoch structure
> EEG.epoch(end -(addchn - 1):end) = [];
>
> % redraw eeglab GUI
> eeglab redraw
> clear NewData a num fakename Siz i addchn
>
> %%%%%%
>
> 3. Now using standard channel (scroll) plotting
>     will show you epochs as electrodes and vice
>     versa. If it does not work correctly - let me know.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20140519/82481159/attachment.html>


More information about the eeglablist mailing list