-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawCorrelateProps.m
53 lines (48 loc) · 1.39 KB
/
DrawCorrelateProps.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
function DrawCorrelateProps(Organized, Props)
Conditions = Organized.Conditions;
ExpNums = unique(Organized.ExpNum);
PropsExpNums = cat(1, Props.ExpNum);
for n = 1:length(Conditions)
Condition = Conditions{n};
TypeName = sprintf('Type_%s', Condition);
h = NamedFigure(sprintf('Correlate %s', Condition));
set(h, 'WindowStyle', 'docked');
x_ptx = [];
x_mod = [];
y = [];
Vals = Organized.(TypeName);
for m = 1:length(ExpNums)
Ind = find(PropsExpNums == ExpNums(m));
if(length(Ind) == 0)
continue
end
P1 = Props(Ind(1));
P2 = Props(Ind(2));
if(strcmp(Condition, 'ptx') | strcmp(Condition, P1.Modulator))
xVal_ptx = .5 * ((P1.VSpike_ptx - P1.VRest_ptx) / P1.R_ptx + ...
(P2.VSpike_ptx - P2.VRest_ptx) / P2.R_ptx);
xVal_mod = .5 * ((P1.VSpike_mod - P1.VRest_mod) / P1.R_mod + ...
(P2.VSpike_mod - P2.VRest_mod) / P2.R_mod);
else
continue;
end
x_ptx = [x_ptx, xVal_ptx];
x_mod = [x_mod, xVal_mod];
Ind = find(Organized.ExpNum == ExpNums(m));
yVal = sum(Vals(Ind) > 0);
y = [y, yVal];
%plot(xVal, yVal, 'b.');
end
if(strcmp(Condition, 'ptx'))
plot(x_ptx, y, 'b.');
else
plot(x_mod, y, 'b.');
hold on
plot(x_ptx, y, 'r.');
hold off
legend('ptx', Condition)
end
xlabel('Current Needed to Excite (nA)')
ylabel('Number of Bursters')
end
return