Plotting cos(omega*t)?

14 visualizaciones (últimos 30 días)
shashank
shashank el 20 de Jun. de 2016
Editada: shashank el 20 de Jun. de 2016
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?

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Annotations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by