[Eeglablist] Add data channel

Arnaud Delorme arno at ucsd.edu
Mon Dec 9 08:20:08 PST 2013


Dear Kristel,

you need to create/load dataset 2 first (with 32 channels) and then you can execute the script.
Best,

Arno

On Dec 9, 2013, at 12:52 AM, kknaepen <kknaepen at vub.ac.be> wrote:

> Dear Arno,
> 
> Thank you for your quick reply.
> 
> I tried the script and I saw that this copies the four channels into the same dataset, so in dataset 1 I go from 4 to 8 channels. But this is not what I would like to see.
> 
> Suppose I put the four channels in dataset 1 like you suggested, I would actually want to add these four channels from datset 1 to dataset 2 (which already contains 32 channels). So in dataset 2 I want to go from 32 channels to 32 + the 4 channels from dataset 1. As I said before both datasets are equally long, synchronized and have the same sample frequency.
> 
> Thanks again.
> 
> Kind regards,
> 
> Kristel
> 
> 
> 
> Arnaud Delorme schreef op 08.12.2013 22:28:
>> If your 4 channels are in dataset 1, that would be the script
>> channel_indices = [1 2 3 4];
>> EEG.data(end+1:end+4,:) = ALLEEG(1).data(channel_indices,:);
>> EEG.nbchan = size(EEG.data,1);
>> if ~isempty(EEG.chanlocs)
>> 	EEG.chanlocs(end+1).labels = '';
>> 	EEG.chanlocs(end+1).labels = '';
>> 	EEG.chanlocs(end+1).labels = '';
>> 	EEG.chanlocs(end+1).labels = '';
>> end;
>> EEG.saved = 'no';
>> [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
>> eeglab redraw
>> Arno
>> On Dec 4, 2013, at 7:46 AM, kknaepen <kknaepen at vub.ac.be> wrote:
>>> Dear,
>>> I would like to add four channels from another dataset (which are
>>> already in a .set file format) to an existing EEG dataset. Both datasets
>>> are equally long, equal sample rate and synchronized.
>>> I found how to add a new EMPTY channel on a previous message:
>>> EEG.data(end+1,:) = 0;
>>> EEG.nbchan = size(EEG.data,1);
>>> if ~isempty(EEG.chanlocs)
>>> 	EEG.chanlocs(end+1).label = '';
>>> end;
>>> [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
>>> eeglab redraw
>>> Could anyone help me change this sript so I could load 4 existing
>>> channels into another dataset, please?
>>> Thanks,
>>> Kristel
>>> _______________________________________________
>>> 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