draw 30 cycles of sinusoid oscillating at 10^6 hz

1 view (last 30 days)
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

More Answers (1)

Fangjun Jiang
Fangjun Jiang on 23 Apr 2021
change to this line
tt=0:T/100:30*T

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!