Nice question!
This is a solution without loops for combining n discontinuous lines (n is 2 in the original post).
Consider n discontinuous lines, each defined by its start and stop points. Consider also an arbitrary test point P. Let S denote the solution, that is, a discontinuous line defined as the intersection of all the input lines. The key idea is: P is in S if and only if the number of start points to the left of P minus the number of stop points to the left of P equals n (considering all points from all lines).
This idea can be applied compactly with vectorized operations:
start = {[1 11 21], [2 10 15 24]}; %// start points
stop = {[3 14 25], [3 12 18 27]}; %// stop points
%// start and stop are cell arrays containing n vectors, with n arbitrary
n = numel(start);
start_cat = horzcat(start{:}); %// concat all start points
stop_cat = horzcat(stop{:}); %// concat all stop points
m = [ start_cat stop_cat; ones(1,numel(start_cat)) -ones(1,numel(stop_cat)) ].';
%'// column 1 contains all start and stop points.
%// column 2 indicates if each point is a start or a stop point
m = sortrows(m,1); %// sort all start and stop points (column 1),
%// keeping track of whether each point is a start or a stop point (column 2)
ind = find(cumsum(m(:,2))==n); %// test the indicated condition
result_start = m(ind,1).'; %'// start points of the solution
result_stop = m(ind+1,1).'; %'// stop points of the solution
With the above data, the result is
result_start =
2 11 24
result_stop =
3 12 25