[Eeglablist] (no subject)

Hilit Serby hilit at sccn.ucsd.edu
Fri Sep 2 10:11:56 PDT 2005


Hi Sven,

There are many ways you can divide the dataset into arbitrary segments, 
this is just one:
create 'fake' events, and then extract epochs based on those 'fake' events.
The script below creates fake events every 0.5 sec between the first 
event of the dataset and the last event (your start and stop markers
assuming they are available as events in the dataset).

bg = EEG.event(1).latency/EEG.srate; %time in sec of first event
en = EEG.event(end).latency/EEG.srate; %time in sec of last event
nu = length((bg+0.5):0.5:(en-0.5)); %number of fake events event every 
0.5 sec

for k = 1:nu
    EEG.event(end+1).type = 'fake';
    EEG.event(end).latency = (bg+k/2)*EEG.srate;
    EEG.urevent(end+1).type = 'fake';
    EEG.urevent(end).latency = (bg+k/2)*EEG.srate;
    EEG.event(end).urevent = length(EEG.event);
end
[ALLEEG EEG ] = eeg_store(ALLEEG, EEG, CURRENTSET);
EEG = pop_editeventvals( EEG, 'sort', {'latency' 0}); %sort the events 
based on their latency
[ALLEEG EEG ] = eeg_store(ALLEEG, EEG, CURRENTSET);
eeglab redraw % update the eeglab GUI

Cheers,
Hilit


Sven Hoffmann wrote:

> Hi,
>
> Does someone know how to divide eeg data sets into segments just by 
> defining an arbitrary time window using matlab (eeglab) (In the data 
> sets are no markers, just start and stop markers). I know it's 
> possible to do so with the VisionAnalyzer and then to export/import to 
> eeglab, that works well, but to my mind it's time consuming.
> Is it possible to do so in eeglab/matlab by the commandline (i found 
> nothing about that in the documentation)?
> i'm working on my diploma thesis and i'd like to do all data 
> processing in matlab, so please :-) help......
>
> regards,
> Sven.
>
>
>
>
>
>  
>
> _______________________________________________
> eeglablist mailing list eeglablist at sccn.ucsd.edu
> http://sccn.ucsd.edu/mailman/listinfo/eeglablist
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to 
> eeglablist-unsubscribe at sccn.ucsd.edu





More information about the eeglablist mailing list