LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mtrace_count.m
1function N = mtrace_count(T,A,t)
2% Computes the count process sample, at resolution, for the marked trace
3% (T,A).
4
5time = sum(T(2:end));
6periods = ceil(time / t);
7C = unique(A);
8
9N = zeros(periods,length(C));
10Tcum = cumsum(T);
11
12for i = 1:periods
13 tstart = T(1) + (i-1) * t;
14 tend = T(1) + i * t;
15 for c = 1:length(C)
16 N(i,c) = sum( Tcum > tstart & Tcum <= tend & A == c );
17 end
18end