Plotting cos(omega*t)?
17 次查看(过去 30 天)
显示 更早的评论
Hi, How do you plot cos(omega*t) where omega=2*pi*f, for range of frequency like (20:2000). I am confused because there is both time and frequency, do we need to convert time to frequency domain?
0 个评论
采纳的回答
Jos (10584)
2016-6-20
编辑:Jos (10584)
2016-6-20
This might guide you a little:
t = linspace(0,10,1000) ; % time vector
f = 20 ; % a frequency
omega = 2.*pi.*f ; % calculate omega
y = cos(omega.*t) ; % calculate cosine for this time span
plot(t,y) % plot it
(btw, I prefer to use the .* notation for multiplication)
5 个评论
Jos (10584)
2016-6-20
the magnitude does not change with the frequency ... Or do you mean something else?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!