LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mtrace_merge.m
1function [T L] = mtrace_merge(t1, t2)
2% Merges two traces in a single marked (multiclass) trace
3% Input
4% t1: inter-arrival times of the first trace
5% t2: inter-arrival times of the second trace
6% Output
7% T: inter-arrival times of the marked process
8% L: labels of the marked process
9
10[TCUM,IDX] = sort([0; cumsum(t1); cumsum(t2)]);
11T = diff(TCUM);
12IDX = IDX(2:end);
13L = zeros(length(T),1);
14L(IDX >= 2 & IDX <= 1+length(t1)) = 1;
15L(IDX >= 2+length(t1) & IDX <= 1+length(t1)+length(t2)) = 2;