‘kappat, Gammat, gammat are functions of df.’
I created them (as well as ‘A’, ‘T’, and ‘fun’) as anonymous functions of ‘df’ to define them as such.
Check this to be certain it prooduces the desired result, otherwise make necessary corrections (since I do not understand what this code does) —
dL = linspace(-6*Gamma,6*Gamma,2000);
kappat = @(df) -i*kappa./2+Dp-dL-df;
Gammat = @(df) -i*Gamma./2-dL-df;
gammat = @(df) -i*rR./2+Dc-dL-df;
A = @(df) -4*gammat(df).*Gammat(df);
T = @(df) T0*(kappa/2)^2.*...
fun = @(df) (exp(-(df.^2./Gammaf^2))./(sqrt(pi)*Gammaf)).*T(df);
q1 = integral(fun,-Inf,0, 'ArrayValued',1);
q2 = integral(fun,0,Inf, 'ArrayValued',1);
Since ‘q’ as originally defined is uniformly 0, I broke it into two regions and added them.