I am using MATLAB R2020b. I currently have a .mat file, which is 1 channel of EEG data of a patient, which displays an array of 1 row by 124877600 columns of numbers.
There is no time vector because the numbers are just the EEG microvolt data.
I reshaped that array to where it would now be 124877600 rows by 1 column. I then converted it to a tall array.
I wanted to convert the tall array into a timetable, but unfortunately the arraytotimetable function does not support you specifying a sampling rate for tall arrays.
By the way, the sampling rate for this channel is 2000 Hz.
Hence, what should I do to incorporate the sampling rate in the file I currently have?
Here is what I did in my code so far:
load('EEGdataset1.mat') % file contains array called EEG_data_day1
EEGarray = reshape(EEG_data_day1,[],1)
EEGtall = tall(EEGarray)
EEGtimetable = array2timetable(EEGtall,'SampleRate',2000) % This last portion won't work because
% SampleRate does work when you use array2timetable on tall arrays. This is the part I am stuck on.

 채택된 답변

Cris LaPierre
Cris LaPierre 2020년 12월 11일
What about making it a timetable before you convert it to a tall array?
load('EEGdataset1.mat') % file contains array called EEG_data_day1
EEGarray = reshape(EEG_data_day1,[],1)
EEGtimetable = array2timetable(EEGarray,'SampleRate',2000)
EEGtall = tall(EEGtimetable);

댓글 수: 5

thank you! i should have thought of that beforehand XD. I'm currently giving that a try right now.
turning the array into a timetable is taking quite a long time
You could try specifying the time vector yourself and then create a timetable using the time variable as your rowtime and EEGtall.
load('EEGdataset1.mat') % file contains array called EEG_data_day1
EEGarray = reshape(EEG_data_day1,[],1)
Fs = 2;
EEGarray = rand(100,1);
t = seconds((0:(length(EEGarray)-1))./Fs)';
EEGtall = tall(EEGtimetable);
EEGtimetable = timetable(t,EEGtall);
You may find the documentation here helpful as well.
Apparently, I found out because I'm going to have to label the EEG data eventually (this is part of a research project), there wasn't any necessity to create the timetable in the first place. It eats up a lot of my computer's memory at home. However, thank you still for your help because i've learned quite some new things about handling large data in Matlab. It has only been my 3rd or 4th time using Matlab XD. .

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

질문:

2020년 12월 11일

편집:

2020년 12월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by