forked from davidjuliancaldwell/DBSanalysisCode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotInternalCCEPs.m
47 lines (38 loc) · 1.39 KB
/
plotInternalCCEPs.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
%% average plots of internal CCEP
prompt = {'What is the condition of interest?'};
dlg_title = 'Condition of interest ';
num_lines = 1;
defaultans = {'4'};
answer = inputdlg(prompt,dlg_title,num_lines,defaultans);
condOfInt = str2num(answer{1});
figure
for j = 1:numEco
subplot(4,4,j)
mu = mean(squeeze(ECoG_sepCCEPinternal{condOfInt}(1:length(tCCEP),:,j)),2);
stdError = std(squeeze(ECoG_sepCCEPinternal{condOfInt}(1:length(tCCEP),:,j)),[],2)/sqrt(size(squeeze(ECoG_sepCCEPinternal{condOfInt}(1:length(tCCEP),:,j)),1));
plot(tCCEP,mu)
hold on
plot(tCCEP, mu+stdError, ':');
hold on;
plot(tCCEP, mu-stdError, ':');
ylabel('Voltage (V)')
xlabel('time (ms)')
title(['Channel ',num2str(j)])
end
subtitle(['ECoG CCEP responses within train for condition = ' num2str(condOfInt)])
figure
for j = 1:numDBS
subplot(2,4,j)
mu = mean(squeeze(DBS_sepCCEPinternal{condOfInt}(1:length(tCCEP),:,j)),2);
stdError = std(squeeze(DBS_sepCCEPinternal{condOfInt}(1:length(tCCEP),:,j)),[],2)/sqrt(size(squeeze(DBS_sepCCEPinternal{condOfInt}(1:length(tCCEP),:,j)),1));
plot(tCCEP,mu)
hold on
plot(tCCEP, mu+stdError, ':');
hold on;
plot(tCCEP, mu-stdError, ':');
ylabel('Voltage (V)')
xlabel('time (ms)')
title(['Channel ',num2str(j)])
end
subtitle(['DBS CCEP responses within train for condition = ' num2str(condOfInt)])
return