Matlab HIgh frequency sine wave generation I need to generated a high frequency sinusoidal signal for modulation in MATLAB. But it turns out to be something weird. This is the simple code snippet I used...

t = 0:0.001:100;
A = 1;
s = A*sin(2*pi*1e9.*t);  %1 GHz signal
plot(t, s);
title('Modulating Signal');
xlabel('Time');
ylabel('Amplitude');


Instead of the sine wave I am getting something weird like this..
The function you need to evaluate is:

A*sin(2*pi*FREQUENCY*(1:NUM_SAMPLES)/SAMPLE_RATE)


Use a reasonable sample rate (at least twice the frequency) and a reasonable interval (remember that at a sample rate of 2Ghz, 1 second of signal will fill up the memory of your computer) ; and it'll work! From your code it seems that you are trying to generating 100s of signal at a sample rate of 1kHz, which doesn't make sense.

At the moment, in your code, the argument of the sin function is an integer multiple of $2\pi$ so in theory your code should be plotting a flat line of 0s. You are seeing something a bit different due to the finite resolution of floating point numbers.