LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
trace_iat2counts.m
1function C=trace_iat2counts(S,scale)
2% computes the counting process of S, i.e., the counts after "scale" units
3% of time from an arrival
4n = length(S);
5CS = cumsum(S);
6C = zeros(1,n-1);
7for i=1:n-1
8 cur = i;
9 while CS(cur + 1) - CS(i) <= scale
10 cur = cur + 1;
11 if cur == n % when the window first hits the end of the trace we return
12 C(i) = cur - i;
13 C=C(1:i);
14 return;
15 end
16 end
17 C(i) = cur - i;
18end
19end