[Eeglablist] Mismatch in duration between EEG struct and eegplot()
Oda van Jole
o.van.jole at medisin.uio.no
Tue Jun 27 01:02:55 PDT 2023
Hi,
I have encountered a strange problem, namely a mismatch in duration between EEG struct and the x-axis in eegplot(). I am pre-processing a resting state EEG recording that consists of 5 minutes eyes open (EO) and 5 minutes eyes closed (EC), in addition to some seconds before, between, and after these sections. I extract the two 5 min sections using pop_select() into an EEG struct (EEGconds) containing the resulting two EEG structs from pop_select() - EO and EC. For each of them, EEG.xmax, size(EEG.data, 2), and the "Epoch end (sec)" in GUI indicates a duration of 300s as expected. When calling eegplot() from code, the x-axis will go to 600 seconds, even with an eeglab redraw first. However, if I use eegplot() manually via GUI, it stops at the 300 sec as expected. Why does this happen? Am I doing something wrong?
Code:
% Extract sections
EOstart = EEG.event(find([EEG.event.edftype] == 1)).latency;
EOend = EEG.event(find([EEG.event.edftype] == 2)).latency;
EEGEO = pop_select(EEG, 'point', [EOstart, EOend]);
% Repeat for EC but with correct event edftypes.
EEGconds.EO = EEGEO; EEGconds.EC = EEGEC;
EEG = EEGconds.EO;
EEG.xmax % ~300
size(EEG.data, 2)/EEG.srate % ~300
eegplot(EEG.data) % Now I can scroll to 600 sec
eeglab redraw;
eegplot(EEG.data) % can still scroll to 600s
This also occurs even if I delete EEGconds from the workspace after assigning EEGconds.EO to EEG.
Thanks very much in advance for your help!
Best wishes,
Oda van Jole
More information about the eeglablist
mailing list