Suppose you imported your data from your recording software into EEGlab. You want to use libEEGTools functionality that is not well implemented in Matlab/EEGlab wrappers.
Unfortunately, there is no reader for Matlab .mat files yet (the format is fairly complicated). It is therefore necessary to import/export data between libeegtools and matlab.
You have 2 options:
libeegtools implements a reader/writer for a simple RAW-format that contains ERP-data for a number of trials and electrodes along with time-marker information. To convert an EEG-struct to RAW, do the following:
To write trials from condition 1 and 2 with 2 time-markers (e.g. stimulus and response) to a file.
matlab> idx = get_epoch_indices( EEG, ['stimulus_onset_condition1' 'stimulus_onset_cond2'] ); matlab> eegset_to_raw( EEG, 2, idx, 'condition1and2.raw');