function E = edges(T, D)

  n = 1;
  E = [];

  for i = 2 : length(T)
    if (D(i-1) == 0 && D(i) == 1)
      E(n) = T(i);
      n = n + 1;
    endif
  endfor

endfunction
