-
Notifications
You must be signed in to change notification settings - Fork 0
/
GA_inspect.m
71 lines (56 loc) · 1.61 KB
/
GA_inspect.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
function [] = GA_inspect(experiment, channels, alignment)
add_filedtrip_path();
cfg = initialize_participant_cfg(experiment, 2);
gram = load([cfg.ERPdir 'gram_GA_' alignment '.mat']);
lex = load([cfg.ERPdir 'lex_GA_' alignment '.mat']);
%% GA butterfly
figure;
for j = 1:2
if j == 1
plot_title = 'Grammatical condition';
y = gram.grandavg.avg;
time = gram.grandavg.time;
else
plot_title = 'Lexical condition';
y = lex.grandavg.avg;
time = lex.grandavg.time;
end
subplot(2,1,j);
for i=1:size(y,1)
plot(time, y(i,:));%-mean(y(i,:),2));
hold on;
end
axis tight;
%Baseline correction
% if strcmp(alignment, 'stim')
% xlim([2 3]);
% end
% ylim([-2 2])
title(plot_title);
hold off;
set(gca,'Ydir','reverse');
end
%
cfg.showlabels = 'yes';
cfg.layout = 'biosemi128.lay';
legend('gram','lex');
cfg.showlabels = 'yes';
cfg.layout = 'biosemi128.lay';
%Baseline correction
% if strcmp(alignment, 'stim')
% cfg.xlim = [2 3];
% end
figure; ft_multiplotER(cfg, gram.grandavg, lex.grandavg);
legend('gram','lex');
figure; counter = 1;
for chan = channels
subplot(length(channels),1,counter);
cfg.channel = chan;
ft_singleplotER(cfg, gram.grandavg, lex.grandavg);
set(gca,'Ydir','reverse');
legend('gram','lex');
counter = counter + 1;
end
clear gram;
clear lex;
end