Hi I have the system defined by the continuous impulse response h_f: 
h_f = exp(-t./tau).*(t>=0);
And I want to compute both the analytical and the numerical solution of it. So here is my code for analytical answer,
w = Fs/2001*(-1000:1000);
ylabel('|H_f| from analytical solution');
ylabel('\angle H_f from analytical solution');
sgtitle('Magnitude and Phase of the Analytical Solution')
And here is my code for numerical solution using the fft()
H_f_numerical = fftshift(fft(ifftshift(h_f)));
magnitude_numerical = abs(H_f_numerical)/2001;
phase_numerical = unwrap(angle(H_f_numerical));
plot(w, magnitude_numerical);
ylabel('|H_f| from numerical solution');
plot(w, phase_numerical);
ylabel('\angle H_f from numerical solution');
sgtitle('Magnitude and Phase of the Numerical Solution')
But when you plot them you can see that they look very different in the magnitude and the phase ( the magnitude at -5 and 5 *10^9 are not exactly 0.2, and the peak height is not 1) (The phase is even worse that it makes no sense) , so I was wondering where I do the code wrong? How to use fft for this continuous time fourier transform?