-
Notifications
You must be signed in to change notification settings - Fork 1
/
segpunch.m
59 lines (49 loc) · 1.1 KB
/
segpunch.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
54
55
56
57
58
59
function [maxima] = segpunch(maxima,pno)
%going to do fancy things in here to ensure maxima are correct
if (pno==1)
return
end
if (pno==2)
newmax = [0,0];
for i=1:length(maxima)
if maxima(i,2) > 0.6
newmax = vertcat(newmax,maxima(i,:));
end
end
newmax(1,:) = [];
end
maxima = newmax;
end
%Use pythagoras to see how close maxima is to next maxima
% distance = 0;
% for i=1:length(maxima)-1
% temp = norm(maxima(i,:)-maxima(i+1,:));
% distance = vertcat(distance,temp); ;
% end
% distance(1,:) = [];
%going to be hacky & removal all maxima < 0.6
% if (pno==2)
% for i=1:length(maxima)
% if maxima(i,2) < 0.6
% maxima(i,2) = 0;
% end
% end
%
% %resize minus zeros
% for i=1:length(maxima)
% if maxima(i,2) == 0
% maxima(i,:) = [];
% end
% end
% %second for loop to get rid of all zeros
% for i=1:length(maxima)
% if maxima(i,2) == 0
% maxima(i,:) = [];
% end
% end
%
%
% end
% end
% Delete range of columns
%m3(:,[1:2]) = [];