MATLAB: Sin wave with difference sampling frequency

MATLABsin

How can generate sine() with 100 ,150,1000,1500 ,sampling frequency ?

Best Answer

Simply change the increments at which the time vector is sampled.
100 Hz sampling frequency:
Fs = 100;
t = 0:1/Fs:1;
x = cos(2*pi*10*t);
Now change Fs to 150 and so son
Fs = 150;
t = 0:1/Fs:1;
x = cos(2*pi*10*t);