-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresponse_counter.m
More file actions
31 lines (28 loc) · 1.28 KB
/
response_counter.m
File metadata and controls
31 lines (28 loc) · 1.28 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
function data_out = response_counter(curr_traces,polars,bsub_map)
%allocate memory for the output
data_out = zeros(5,1);
switch polars
case 1 %excitation
%get the minimum deflection in the map
data_out(1) = min(bsub_map(:));
%calculate the number of direct traces
data_out(2) = sum(curr_traces(:,5)==0);
%calculate the number of second window traces
data_out(3) = sum(curr_traces(:,5)==2);
%calculate the number of synaptic traces
data_out(4) = sum(curr_traces(:,5)==1);
case 2 %inhibition
%get only the analyzed traces
temp_trace = bsub_map(:,curr_traces(:,5)>0);
%calculate the percentage of positive charge in the map wrt the
%total
data_out(1) = sum(temp_trace(temp_trace(:)>0))/sum(abs(temp_trace(:)));
%calculate the number of direct traces and neg bigger
data_out(2) = sum(curr_traces(:,5)==0);
%calculate the number of synaptic traces and pos bigger
data_out(3) = sum(curr_traces(:,5)==1);
%calculate the number of synaptic traces and neg bigger
data_out(4) = sum(curr_traces(:,5)==2);
%calculate the number of direct traces and pos bigger
data_out(5) = sum(curr_traces(:,5)==3);
end