Borrar filtros
Borrar filtros

how to load multiple eeg dataset files into matlab?

7 visualizaciones (últimos 30 días)
Prachi
Prachi el 25 de Abr. de 2024
Comentada: Cris LaPierre el 25 de Abr. de 2024
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

Respuestas (1)

Cris LaPierre
Cris LaPierre el 25 de Abr. de 2024
Editada: Cris LaPierre el 25 de Abr. de 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.

Categorías

Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by