Discrete Fourier Transform a dummy approach
It should be OK. You did not specify how you obtain the vector $t$ used in generating $x$, but otherwise everything seems fine. I haven't used $\tt{bsxfun}$ but I would simply write the DFT like this:
$$\tt{dummydft=x*exp(-2*pi*i*(n'*k)/N);}$$
I've tried it and it gives the same result as $\tt{fft(x)}$.