>> TGS_phase_analysis('V_single_crystal-2019-06-30-06.40um-0degrees#2-POS-1.txt','V_single_crystal-2019-06-30-06.40um-0degrees#2-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.04937  (0.04888, 0.04985)
       k =   2.422e-05  (2.382e-05, 2.461e-05)
       beta =    3.27e-12  (fixed at bound)
       B =    0.005639  (0.005439, 0.005839)
       p =      -2.006  (-2.029, -1.982)
       t =   6.738e-08  (6.391e-08, 7.085e-08)
       D =  -1.027e-05  (-7.742e-05, 5.687e-05)
     Problem parameters:
       q =   9.817e+05
       start_time =     2.7e-09
       peak_freq =   3.975e+08
Bad fit for:V_single_crystal-2019-06-30-06.40um-0degrees#2-POS-1.txt~re: beta

ans =

   3.9751e+08