draw 30 cycles of sinusoid oscillating at 10^6 hz

5 views (last 30 days)
Hessa Alhajri
Hessa Alhajri on 23 Apr 2021
Commented: VBBV on 26 Apr 2021
i was trying to plot 30 cycles of a sinusoid oscillating at 10^6, so I tried with following code
>> fs=10^6;
>> T=1/fs;
>> tt=0:0.1:30*T;
>> m=cos(2*pi*fs*tt);
>> plot(tt,m)
but no graph is appear!

Accepted Answer

VBBV
VBBV on 23 Apr 2021
%f true
fs=10^6;
T=1/fs;
tt=0:0.1*T:30*T;
m=cos(2*pi*fs*tt);
plot(tt,m)
Try this

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by