I have to plot the signal m(t) = ASin(2pi1000t) and I am using the following Matlab code to do it.
Fm=1000;%1 kHz
Fs = 2*Fm;
t = 0:1/Fs:10; % ( that is, time will run from 0 to 10 with a sample at every 1/2000th second )
Am=1;%amplitude
m=Am*sin(2*pi*Fm*t);
figure(1)
plot(t,m)
title('Message signal')
xlabel('Time in Seconds')
ylabel('m(t)')
However, I am getting the plot as
But on the other hand, if I use the following code,
Fm=1000;%1 kHz
t=linspace(0,10,2000);
Am=1;%amplitude
m=Am*sin(2*pi*Fm*t);
figure(1)
plot(t,m)
title('Message signal')
xlabel('Time in S')
I am getting a proper sin wave. What's actually happening here? What is wrong with the first code?

