-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchroFunc.m
More file actions
49 lines (36 loc) · 955 Bytes
/
chroFunc.m
File metadata and controls
49 lines (36 loc) · 955 Bytes
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
function eventRes = chroFunc(nodeID,chroData)
risingEdgs = [];
fallingEdgs = [];
eventsList = [];
% whether at least a signal is empty?
flag = 0;
% extracting Epsilon from the cell array
signalNum = size(chroData);
signals = chroData(1:end,:);
% disp('chroFunc');
% disp(chroData);
% disp(signals);
% disp('events');
% the events to find the simulttaneity
events = signals (1:end,3);
eventsValues = events(:,1);
% disp('eventsValues');
% disp(eventsValues);
for i = 1 : signalNum
temp = events{i};
if(~isempty(temp))
eventsList = [eventsList,temp(1)];
else
flag = 1;
end
end
if(flag==0)
disp(eventsList);
sortedEvents = sort(eventsList);
if(sortedEvents == eventsList)
risingEdgs = [risingEdgs,eventsList(length(eventsList))];
fallingEdgs = [fallingEdgs, -1];
end
end
eventRes = {nodeID,5,risingEdgs,fallingEdgs};
end