Hi, thanks again :)
If I change from t(end)=2 to other value then U2(f) will change its amplitude if I use dt instead of length(t).
But it's ok, I will check it with books. Do you know in which book or which section they discuss this topic?
Thanks so much.
However, if I using this way for cosine function, then it doesn't work again.
u2=1*cos(20*t);
U2=fftshift(fft(u2))*dt;
This time, when I change the time setting, the value of U2 will change.
It's so strange.
Homework Statement
Dear all,
I have a problem when I using MATLAB to get the Fourier transform of dirac delta function. below is my code.Homework Equations
clear all;
clc;
close all;
% t=0:0.002:2;
t=0:0.002:4;
dt=t(2)-t(1);
u=zeros(size(t));
pos0=find(t>=1,1);
u(pos0)=1/dt...