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

조회 수: 6 (최근 30일)
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).

답변 (1개)

Mohammad Dar
Mohammad Dar 2019년 10월 2일
have you tried this:
[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG);

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

제품


릴리스

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by