-
Notifications
You must be signed in to change notification settings - Fork 0
/
window_finder.m
21 lines (21 loc) · 1.04 KB
/
window_finder.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function [windows] = window_finder(boundaries_in_file,j,number_of_crossings,length_of_window,how_many_windows)
windows = floor(boundaries_in_file(9,j)/length_of_window);
if number_of_crossings > 1
if j == 1
if boundaries_in_file(9,j) == boundaries_in_file(9,j+1) &&...
floor(boundaries_in_file(9,j)/length_of_window) < how_many_windows
windows = ceil(floor(boundaries_in_file(9,j)/length_of_window)/2);
end
elseif j == number_of_crossings
if boundaries_in_file(9,j) == boundaries_in_file(9,j-1) &&...
floor(boundaries_in_file(9,j)/length_of_window) < how_many_windows
windows = ceil(floor(boundaries_in_file(9,j)/length_of_window)/2);
end
else
if boundaries_in_file(9,j) == boundaries_in_file(9,j+1)...
|| boundaries_in_file(9,j) == boundaries_in_file(9,j-1)
windows = ceil(floor(boundaries_in_file(9,j)/length_of_window)/2);
end
end
end
end