periodogram example code

6 visualizaciones (últimos 30 días)
john birt
john birt el 21 de Jul. de 2011
I am trying to get to grips with plotting a periodogram of a financial time series using Matlab. My first port of call was the product documentation for the periodogram on the mathworks website, http://www.mathworks.com/help/toolbox/signal/periodogram.html.
So I went and copied there example code into Matlab, below
Fs = 1000;
t = 0:1/Fs:.3;
x = cos(2*pi*t*200)+0.1*randn(size(t));
periodogram(x,[],'onesided',512,Fs)
but this just gives me an error
??? Attempt to execute SCRIPT periodogram as a function:
C:\Users\Currys\Documents\MATLAB\periodogram.m
what did I do wrong? How can I get to see this example code in practice?

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 21 de Jul. de 2011
You wrote a script called 'periodogram.m' located at C:\Users\Currys\Documents\MATLAB\periodogram.m.
It's trying to call your script. Change your script's name to something else and then run it.
  1 comentario
john birt
john birt el 21 de Jul. de 2011
cheers, how stupid of me!!!!!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB 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