This is a substitute of the function 'FFT'.
The screen shot is a graph in 3-D coordinate. X-axis defines k, y-axis and z-axis define real and imaginary parts of X(k). Here X(k) is the FFT output of x1(input). I did it in 3-D cause in simple stem the figure only contains imaginary part of X(K).
I've non idea which algorithm is used in MATLAB 'FFT'. There may be a difference in algorithm,but we can't see it.So I implemented my own.
Please explain what we see in the screenshot and the differences between Matlab's fft and your implementation.