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.