EEG script: problem in uploading multiple files into EEGLAB using a "for" loop pre-made script

6 views (last 30 days)
I'm supposed to adapt a pre-made script (devised to upload multiple EEG datasets and perform filtering and resampling in one step) to the dataset files I have in my PC. I'm new to MATLAB so sorry for very naive mistakes. When I run this code (this is a reduced version of it, for simplicity)
for x = 1:17
filepath = ['/Users/mimmo/Desktop/cartella senza titolo 2/sample data EEG/' num2str(x) '17_GCBS_H3-01_PASAT.eeg']
fname = ['17_GCBS_H3-01_PASAT' int2str(x) '_PASAT']
EEG = pop_fileio(filepath);
EEG = pop_editset(EEG, 'setname', fname);
EEG = pop_select( EEG,'nochannel',{'ECG'});
end
I'm supposed to access the folder referred to the path I specified and execute the three "pop" operations along the 17 files contained in the folder. Unfortunately, the way I devised this doesn't work at all.
I am supposed to modify it by keeping the commands the same, just by changing the inputs. The files contained in the folder I should loop for are all named "17_GCBS_H3-**_PASAT.eeg", where ** is the only changing part and it refers to the dataset number, ranging from 01 to 17.
I tried different ways but all I can do is to loop 17 times on the "01" dataset (I also removed the "num2str" command which is something I'm normally not allowed to do).

Answers (1)

Mohammad Dar
Mohammad Dar on 2 Oct 2019
have you tried this:
[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG);

Categories

Find more on EEG/MEG/ECoG in Help Center and File Exchange

Products


Release

R2014b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!