Concatenate Matlab dataset files

1 次查看(过去 30 天)
Hi Folks,
I am doing some EEG analysis and have several files to merge them, I have to only use row 126 in each file. my files have 257 rows and 117917 columns. I have tried below and failed, saying Index exceeds matrix dimensions.
%A=fullfile('E:\PhD_Master_Dessertation+Scholarships\PhD_Tor Vergata\Study materials\PhD Work\Resources\SSVEP_Based_BCI\Codes\Extraction\FFT\MAMEM EEG SSVEP Dataset I\S001a.mat');
%B=fullfile('E:\PhD_Master_Dessertation+Scholarships\PhD_Tor Vergata\Study materials\PhD Work\Resources\SSVEP_Based_BCI\Codes\Extraction\FFT\MAMEM EEG SSVEP Dataset I\S001b.mat');
X1=importdata('E:\PhD_Master_Dessertation+Scholarships\PhD_Tor Vergata\Study materials\PhD Work\Resources\SSVEP_Based_BCI\Codes\Extraction\FFT\MAMEM EEG SSVEP Dataset I\S001a.mat'); % read first file
X2=importdata('E:\PhD_Master_Dessertation+Scholarships\PhD_Tor Vergata\Study materials\PhD Work\Resources\SSVEP_Based_BCI\Codes\Extraction\FFT\MAMEM EEG SSVEP Dataset I\S001b.mat'); % and second
%dat=interp1(X1(126,:),X2(126,:)); % interpolate 2nd to match first time data
dat=[X1(126,:) X2(126,:)];
%dataset3 = concat(dataset1,dataset2);
% C = sortrows(unique([A(126,:);B(126,:)],'rows'));
% C = [C,nan(size(C))];
% C(ismember(C(126,:),A(126,:),'rows')) = A(126,:);
% C(ismember(C(126,:),B(126,:),'rows')) = B(126,:);
  2 个评论
Tanmay Das
Tanmay Das 2020-7-15
Hi. Can you please attach both the files i.e. S001a and S001b
Bayar Shahab
Bayar Shahab 2020-7-16
编辑:Bayar Shahab 2020-7-16
the file sizes were almost 256 MB, So I have created a shared link:

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2020-7-16
X1 = load('E:\PhD_Master_Dessertation+Scholarships\PhD_Tor Vergata\Study materials\PhD Work\Resources\SSVEP_Based_BCI\Codes\Extraction\FFT\MAMEM EEG SSVEP Dataset I\S001a.mat'); % read first file
X2 = load('E:\PhD_Master_Dessertation+Scholarships\PhD_Tor Vergata\Study materials\PhD Work\Resources\SSVEP_Based_BCI\Codes\Extraction\FFT\MAMEM EEG SSVEP Dataset I\S001b.mat'); % and second
dat1 = X1.eeg(126,:);
dat2 = X2.eeg(126,:);
At the moment it does not make sense to interp1() between the two of them. They both have the same sampling rate, so they have the same implied time for the first 117917 columns, and the second one simply ran for 0.352 seconds more.

类别

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

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by