How can I generate a pulse train in the frequency domain?
The train of pulses in the time domain:
$$x(t)=|||(t)=\sum_{i=1}^{\infty} \delta(t-i)$$

Equals to the following train of pulses in the frequency domain:
$$\mathbb{F}x=|||(f)=\sum_{i=1}^{\infty} \delta(f-i)$$

Where $|||$ is the train of unitary pulses, comb standard signal.

Hence:
$$|||(t) \rightarrow |||(f)$$

The train of unitary pulses in time domain separated by $\tau$ is (do you know why we are having $1/\tau$?):
$$1/\tau|||(t/\tau) \rightarrow |||(\tau f)$$

And the train of unitary pulses in frequency domain separated by $1/\tau$ is:
$$|||(t/\tau) \rightarrow \tau|||(\tau f)$$

NOW when having a sampling time of $dt$, each delta pulse in the instant $i$ can be represented in discrete time as:
$$\delta(t-i)=\frac{1}{dt}\delta_{ti}$$
Where $\delta_{ti}=1$ for $t=i$ and 0 elsewhere, as in the discrete kronecker delta sense, approximating each pulse as the smallest possible rectangle (other approximations are possible though...).

In discrete time/frequency, we just have to replace the proper $delta$ implementation, as already defined.

Finally, the $\infty$ in the time sum is bounded to $T$, the total measuring time, and to $F=0.5/dt$, the sampling frequency band (nyquist?). So the period $\tau$ must be divisor of $T$, $T=\phi\tau$, and $1/\tau$ must be a divisor of $F=0.5/dt$, $T\phi=0.5\tau N$  for the numbers in the FFT algorithm to be squared in order to create a perfect periodic sequence in both the time and frequency streams. 

HENCE, the standard FFT algorithm, for example with $\tau=6$, $\phi=3$ and $dt=1$ (for simplicity):

tau=6;
phi=3;
T=phi*tau;
x=1/phi*repmat(eye(1,tau),1,phi);
Fx=fft(x)


Implements the non unitary train of pulses in time domain:

x=1/3*[1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0]


with the unitary train of pulses in frequency domain:

Fx=[1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0]