>> TGS_phase_analysis('V_single_crystal-2019-06-30-06.40um-30degrees#3-POS-1.txt','V_single_crystal-2019-06-30-06.40um-30degrees#3-NEG-1.txt',6.4,1)

f2 = 

     General model:
     f2(x) = A.*(erfc(q*sqrt(k*(x+start_time)))-beta*exp(-q^2*k*(x+start_time)
                    )./sqrt((x+start_time)))+B.*sin(2*pi*(peak_freq)*(x+
                    start_time)+p)*exp(-(x+start_time)/t)+D
     Coefficients (with 95% confidence bounds):
       A =     0.07033  (0.06933, 0.07132)
       k =   1.112e-05  (1.093e-05, 1.132e-05)
       beta =   6.675e-07  (-1.931e-07, 1.528e-06)
       B =     0.01503  (0.01484, 0.01522)
       p =       2.106  (2.097, 2.115)
       t =   4.105e-08  (4.031e-08, 4.179e-08)
       D =    0.001158  (0.0009948, 0.001322)
     Problem parameters:
       q =   9.817e+05
       start_time =     1.5e-09
       peak_freq =    3.96e+08

ans =

   3.9600e+08