Created
May 11, 2018 02:59
-
-
Save sylvchev/259a390e0b879d95b0d51a6918fea609 to your computer and use it in GitHub Desktop.
Convert EEG GDF file to matlab file (then python)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear all | |
datadir='/path/to/data/ssvep-esta/'; | |
for i = 2:2 | |
subjdir = strcat(datadir, sprintf('subject%2.2d/', i)); | |
files = dir(strcat(subjdir, '*.gdf')); | |
for f=1:length(files) | |
[s,h] = sload(strcat(subjdir, files(f).name)); | |
EVENTTYP = h.EVENT.TYP; | |
EVENTPOS = h.EVENT.POS; | |
SampleRate = h.SampleRate; | |
[~ ,FileName, ~] = fileparts(files(f).name); | |
save(strcat(subjdir, FileName, '.mat'), 's', 'EVENTTYP', 'EVENTPOS', 'SampleRate', 'FileName'); | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment