For example, we have 2 beams combining and we would like to be sure that the 2 beams are interfering destructively (for example be at dark fringe after the recombination at the beamsplitter). The idea is to find the relative phase between the 2 beams and then cancel it. That could be simply by:
alpha = Calculate_Overlap(E1,E2); % calculate the complex overlap
E_DP = E2 + E1*exp(-1i*(angle(alpha) + pi)); % offset one beam in phase and combine the 2 beams