Concatenate Matlab dataset files
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 16 de Jul. de 2020
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 comentarios
Ver también
Categorías
Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!