-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrace_process.m
More file actions
61 lines (59 loc) · 2.38 KB
/
Trace_process.m
File metadata and controls
61 lines (59 loc) · 2.38 KB
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
function map_value = Trace_process(in_trace,resp_type,polarity)
% %assume a sampling frequency of 10 kHz
% sf = 10000;
switch polarity
case 1 %excitatory
switch resp_type
case 0
%here just blank
map_value = NaN;
case 1
%rectify negative
in_trace(in_trace>0) = 0;
%calculate the integrated current
map_value = trapz(in_trace)./(length(in_trace));
case 2
%rectify negative
in_trace(in_trace>0) = 0;
%calculate the integrated current
map_value = trapz(in_trace)./(length(in_trace));
case 3
%here just make them 0
map_value = 0;
case 4
%rectify negative
in_trace(in_trace>0) = 0;
%calculate the integrated current
map_value = trapz(in_trace)./(length(in_trace));
end
case 2 %inhibitory
switch resp_type
case 0
%here just blank
map_value = NaN;
% %calculate the integrated current, rectified
% in_trace(in_trace<0) = 0;
% map_value = trapz(in_trace)./(length(in_trace)/sf);
case 1
% %calculate the integrated current
% map_value = trapz(in_trace)./(length(in_trace)/sf);
%calculate the integrated current, rectified
in_trace(in_trace<0) = 0;
map_value = trapz(in_trace)./(length(in_trace));
case 2
% %calculate the integrated current, rectified
% in_trace(in_trace<0) = 0;
% map_value = trapz(in_trace)./(length(in_trace)/sf);
%calculate the integrated current, rectified
in_trace(in_trace<0) = 0;
map_value = trapz(in_trace)./(length(in_trace));
case 3
%calculate the integrated current, rectified
in_trace(in_trace<0) = 0;
map_value = trapz(in_trace)./(length(in_trace));
case 4
%calculate the integrated current, rectified
in_trace(in_trace<0) = 0;
map_value = trapz(in_trace)./(length(in_trace));
end
end