There is no need for doing collect or [ ;] most of the time. Whenever you use a range as input to a vectorized function, like sin, it returns a vector as expected.
This code should do the same as the one you posted:
function jakes_flat(fd, Ts, Ns, t0 = 0.0, E0 = 1.0, phi_N = 0.0)
N0 = 8
N = 4N0 + 2
wd = 2π * fd
t = t0 + (0:Ns-1) * Ts
tf = t[end] + Ts
coswt = [√2cos(wd*t)' ; 2cos(wd*cos(2π*(1:N0)/N)*t')]'
temp = [phi_N; π*(1:N0)/(N0+1)]
h = E0/√(2N0+1) * coswt * exp(im*temp)
return (h, tf)
end
