Draw edf plots using "for loop"
이전 댓글 표시
OK so this question is continuing my yesterday's question about accessing the edf table using for loop.
I have a table like this:
tt = edfread('example.edf')
then I did several edf info extractions:
info = edfinfo('example.edf');
fs = info.NumSamples/seconds(info.DataRecordDuration);
after that I did the plot for the first record of the first signal, which refers to "EEG 0 sec" data:
recnum = 1;
signum = 1;
t = (0:info.NumSamples(signum)-1)/fs(signum);
y = tt.(signum){recnum};
plot(t,y)
or this one for the fifth record of the second signal, which refers to "EEG2 40 sec":
recnum = 5;
signum = 2;
t = (0:info.NumSamples(signum)-1)/fs(signum);
y = tt.(signum){recnum};
plot(t,y)
but for my case I would like to extract and plot all data:
- "ECG" from 0 sec up to 50 sec
- "ECG2" from 0 sec to 50 sec as well.
And for this case I would like to use "for loop" method. I tried to figure out what works in the loop but I totally have no idea. Can you help me to figure it out? Thank you
댓글 수: 6
Walter Roberson
2023년 4월 14일
Is there an implication that the 1280 samples at time 0 are actually distributed between time 0 and time 10 ? If so then do you want to plot the groups for times 0, 10, 20, 30, 40, or do you want to plot the groups for time 0, 10, 20, 30, 40, 50, or do you want to plot the groups for times 0, 10, 20, 30, 40, plus the first sample from the group for time 50 ?
Edoardo
2023년 4월 15일
Edoardo
2023년 4월 15일
Walter Roberson
2023년 4월 16일
According to your table, you have samples for each of 1280 different channels, with the samples taken every 10 seconds. According to your table, you do not (for example) have any data at time 1 second, or 2 seconds, and so on -- only at 0 seconds,10 seconds, 20 seconds, and so on.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




