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 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!