-
Notifications
You must be signed in to change notification settings - Fork 6
/
makeERPMovie.m
73 lines (51 loc) · 1.33 KB
/
makeERPMovie.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
clear all
close all
clc
load('sampleData');
vidObj = VideoWriter('TED');
open(vidObj);
theChannel = 5;
sRate = 500;
x1 = 1;
x2 = 500;
f = figure
EEG = doFilter(EEG,0.1,100,2,60);
yLimit = 40;
for i = 1:2000
set(gcf,'color','k');
currentData1 = squeeze(EEG.data(1,x1:x2));
currentData2 = squeeze(EEG.data(11,x1:x2));
currentData3 = squeeze(EEG.data(43,x1:x2));
currentData4 = squeeze(EEG.data(52,x1:x2));
subplot(3,1,1);
xValues1 = 1:1:500;
p1 = plot(xValues1,currentData1,'LineWidth',3,'Color','r');
ylim([-1*yLimit yLimit]);
xlim([1 500]);
ylabel('AF7');
set(gca,'visible','off');
set(gca,'Color','k');
subplot(3,1,2);
xValues2 = 1:1:500;
p2 = plot(xValues2,currentData2,'LineWidth',3,'Color','g');
ylim([-1*yLimit yLimit]);
xlim([1 500]);
ylabel('AF8');
set(gca,'visible','off');
set(gca,'Color','k');
subplot(3,1,3);
xValues3 = 1:1:500;
p3 = plot(xValues3,currentData3,'LineWidth',3,'Color','b');
ylim([-1*yLimit yLimit]);
xlim([1 500]);
ylabel('TP9');
set(gca,'visible','off');
set(gca,'Color','k');
drawnow;
currentFrame = getframe(f);
% write the frame to the video file
writeVideo(vidObj,currentFrame);
x1 = x1 + 5;
x2 = x2 + 5;
end
close(vidObj);