Azzera filtri
Azzera filtri

how to load multiple eeg dataset files into matlab?

7 visualizzazioni (ultimi 30 giorni)
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

Risposte (1)

Cris LaPierre
Cris LaPierre il 25 Apr 2024
Modificato: Cris LaPierre il 25 Apr 2024
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.

Categorie

Scopri di più su EEG/MEG/ECoG in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by