how to load multiple eeg dataset files into matlab?

7 次查看(过去 30 天)
i have 88 eeg data files, their extension is '.set'
they are all in the same folder titled 'all_data', i am really new at MATLAB, i am unable to figure out how to load all of them at once in my workspace.
i used the line below to load one file, but doing the same for 88 files is a lot of hassle
eegdata= pop_loadset('C:\Users\Parul\Documents\MATLAB\secondary_data\all data\sub-01_task-40HzAuditoryEntrainment_eeg.set')
Please help

回答(1 个)

Cris LaPierre
Cris LaPierre 2024-4-25
编辑:Cris LaPierre 2024-4-25
I would use a fileDatastore to load all the data into a single variable. You can see an example of how to use one to do this in this video from the Data Processing with MATLAB specialization on Coursera.
Here is the final code from that example. You can modify this to work for your data.
flightsDataStore = fileDatastore("flights*.csv","ReadFcn",@importFlightsData,"UniformRead",true);
flightsAll = readall(flightsDataStore)
Once complete, all the data from all files matching the pattern "flights*.csv" are loaded into the variable flightsAll.

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by