LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mtrace_split.m
1function [TL] = mtrace_split(T, L)
2% Given a multi-class trace with inter-arrivals T and labels L,
3% creates the separate per-class traces. In each per-class trace
4% the inter-arrivals are inter-arrivals between events of the same class.
5% The result is a cell array and the c-th element of the cell array
6% contains the vector of inter-arrival times for class c.
7
8labels = unique(L);
9C = length(labels);
10
11TL = cell(1,C);
12
13TCUM = cumsum(T);
14for c = 1:C
15 TL{c} = diff([0; TCUM(L == labels(c))]);
16end
17
18end