-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathset_gap.m
41 lines (21 loc) · 1021 Bytes
/
set_gap.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
function [b_ideal]= set_gap(b_gap,events_in_stage,lateral_out_of_stage, m_dividing,Data_Locations,b_old_dividing)
events_in_stage=[];
events_in_previous_stage=[];
events_in_next_stage=[];
if (size(events_in_stage,1)./(size(events_in_stage,1)+size(lateral_out_of_stage,1)).*100) >10
for i=1:length(Data_Locations)
%within stage if between start and end line.
if Data_Locations(i,2)>(m_dividing.*Data_Locations(i,1)+b_old_dividing)
events_in_previous_stage=[events_in_previous_stage;Data_Locations(i,:)];
end
if Data_Locations(i,2)>(m_dividing.*Data_Locations(i,1)+b_old_dividing) && Data_Locations(i,2) >(m_dividing.*Data_Locations(i,1)+b_gap)
events_in_stage=[events_in_stage;Data_Locations(i,:)];
end
if Data_Locations(i,2)<(m_dividing.*Data_Locations(i,1)+b_gap)
events_in_next_stage=[events_in_next_stage;Data_Locations(i,:)];
end
end
b_gap=b_gap+1;
end
b_ideal=b_gap;
end