1function C=mtrace_iat2counts(T,A,scale,no_mex)
2% Computes the per-
class counting processes of T, i.e., the counts after
3%
"scale" units of time from an arrival.
5% - T: inter-arrival times
7% - scale: time after an arrival
8% - no_mex: set to 1 to avoid
using the mex file (optional,
default = 0)
10% - C: column k
is the counting process
for class k
16if ~no_mex && exist(
'mtrace_iat2counts_native') == 3
17 C = mtrace_iat2counts_native(T,A,scale);
19 warning(
'Using slow Matlab function instead of MEX file.');
23 C = zeros(n-1,length(K));
26 % speedup loop by looking at the previous value
31 while CT(cur + 1) - CT(i) <= scale
33 % when the window first hits the end of the trace we
return
36 C(i,j) = sum(A((i+1):cur) == K(j));
43 C(i,j) = sum(A((i+1):cur) == K(j));