[Eeglablist] A question about extracting single trial EEG data
Cedric Cannard
ccannard at protonmail.com
Wed Mar 27 11:20:02 PDT 2024
Hi Song,
If I understand correctly, and assuming you have already epoched your data for each condition. Here is an example to get the average ERP across trials for the latencies 100-300 ms post-stimulus:
lats = [100 300]; % edit with your latency bounds of interest (in ms)
idx = EEG.times>=lats(1) & EEG.times<=lats(2);
ERP = squeeze(mean(EEG.data(:,idx,:),3)); % idx keeps only the window of interest, and mean on 3rd dimension averages across trials
Or if you haven't epoched your data yet, you can do so like this (from -300 ms to + 1000 ms):
EEG = pop_epoch(EEG, {'condition1' 'condition2'}, [-.3 1.5]);
Note that conditions here correspond to your event markers.
Hope this helps,
Cedric Cannard
Cedric
On Tuesday, March 26th, 2024 at 3:08 PM, 宋庆一 via eeglablist <eeglablist at sccn.ucsd.edu> wrote:
> Hi~
>
>
> I am currently working on single trial analysis, but I don't know how to extract single trial EEG data (actually what I want is ERP data, i.e. the averange of certain time window). I would really appreciate it if someone could help me.
>
>
> Sincerely,
> Song
>
>
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
More information about the eeglablist
mailing list