How to convert a .mat file to a .set file in MatLab?
57 次查看(过去 30 天)
显示 更早的评论
Khan Muhammad Adeel Khan
2020-7-14
评论: Dibyajyoti
2023-9-2
Hello!
I want to convert .mat file into eeglab readable format .set. Kindly guide me about the conversion method?
0 个评论
采纳的回答
Ir. Ts. Dr. Kah Yung Yap, CEng (UK)
2020-7-15
Dear Khan Muhammad Adeel Khan,
It is necessary to input the correct dimensions of the input data (such as number of samples, number of epochs) when you are using the GUI to load a .mat file. EEGLab requires a dataset to be in the format as the following: "Electrodes x Times x Trials". Before importing .mat into EEGLab, you will need to load your data files into MATLAB and use reshape or other function to format it in the correct way. More details and information can be found here:
I hope this information will be useful. Thank you.
2 个评论
Dibyajyoti
2023-9-2
I am able to load the .mat file from http://bnci-horizon-2020.eu/database/data-sets for the Two class motor imagery (002-2014) .mat file of participant S01T.
But I am facing one small problem:
I have to keep the number of time points to be same across all the trials. Which is not the case for the dataset that I have downloaded.
Two_Class_S01=load('S01T.mat')
Data_Two_Class_S01 = Two_Class_S01.data
X11_Data= Data_Two_Class_S01{1,1}.X
% Accessing total number of trials
trial_11_S0 = Data_Two_Class_S01{1,1}.trial
% Initializing Three Dimensional Data as time points x channels (15 is channels) x number of
% trials (k stands for number of trials)
for k = 1:numel(trial_11_S0)
ThreeDim_Trial(:, :, k) = ones(trial_11_S0(1),15)
end
for k = 1:numel(trial_11_S0)
if k == 1
ThreeDim_Trial(:,:, k) = X11_Data(1:trial_11_S0(1),:);
else
ThreeDim_Trial(:, :, k) = X11_Data(trial_11_S0(k-1)+1: trial_11_S0(k-1)+trial_11_S0(1),:);
end
end
% Reshaping of Three Dimensional Data as channels (15 is channels) x time points x number of
% trials (k stands for number of trials)
perm_data = permute(ThreeDim_Trial,[2 1 3])
size(perm_data)
The only problem is: I have to keep the number of columns (i.e. number of tme points in a trial) to be same in the 2D array across all the k-th trial.
更多回答(2 个)
Ir. Ts. Dr. Kah Yung Yap, CEng (UK)
2020-7-14
Hi, you may use the GUI to load the array: File>>Import Data>> Using EEGLab functions and plugins>>from ASCII/float file or Matlab array. You may write the name of the matrix in the workspace and select "Matlab array".
You may also find these answers useful:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!