Concatenate Matlab dataset files

조회 수: 1 (최근 30일)
Bayar Shahab
Bayar Shahab 2020년 7월 15일
답변: Walter Roberson 2020년 7월 16일
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