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.

This is a script, which needs INPUT to define the data and therefore less usable than a function. The magic and brute clearing "clc, clear all, close all" destroys all former work of the users, when they try to run the code. I strongly recommend to omit such clearing, because it is not useful at all.
The Matlab function WEEKDAY finds the day of the week also.
The code can be much more compact using something like this:
Days = {'SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY'};
Verb = {'was', 'is', 'will be'};
fprintf('The day %s %s\n', ...
Verb{2 + sign(n - datenum(date))}, Days{d})
But a SWITCH block or at least some ELSEIF would be an improvement also.

A script with the brute clearing header, INPUT, and a large redundant code is neither useful for productive work nor for educational purposes. The code works, but who can or will use this?

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.

This is a script, which needs INPUT to define the data and therefore less usable than a function. The magic and brute clearing "clc, clear all, close all" destroys all former work of the users, when they try to run the code. I strongly recommend to omit such clearing, because it is not useful at all.
The Matlab function WEEKDAY finds the day of the week also.
The code can be much more compact using something like this:
Days = {'SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY'};
Verb = {'was', 'is', 'will be'};
fprintf('The day %s %s\n', ...
Verb{2 + sign(n - datenum(date))}, Days{d})
But a SWITCH block or at least some ELSEIF would be an improvement also.
A script with the brute clearing header, INPUT, and a large redundant code is neither useful for productive work nor for educational purposes. The code works, but who can or will use this?

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.

Comment only