Plotting cos(omega*t)?

조회 수: 14 (최근 30일)
shashank
shashank 2016년 6월 20일
편집: shashank 2016년 6월 20일
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?

채택된 답변

Jos (10584)
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)
Jos (10584) 2016년 6월 20일
the magnitude does not change with the frequency ... Or do you mean something else?
shashank
shashank 2016년 6월 20일
편집: shashank 2016년 6월 20일
This is exactly what i wanted to knw, so magnitude do not change with frequency for f=cos(w*t)?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by