multiple periodograms

조회 수: 1 (최근 30일)
john birt
john birt 2012년 6월 8일
I have some data in vector 'x'. I can compute a periodogram easily enough by
y=x;
[Pxx,w] = pwelch(y);
Great, all is good, BUT if I want to transform 'x' to absolute values and compute the periodogram for this as well, like
y=(x);
y2=abs(x);
[Pxx,w] = pwelch(y);
[Pxx,w] = pwelch(y2);
Well does not really work, I am just re-writing [Pxx,w] !
so I try like
y=(x);
y2=abs(x);
[Pxx,w] = pwelch(y);
[2Pxx,2w] = pwelch(y2);
But then I have a syntax error as [2Pxx,2w] is not allowed, I must use 'Pxx' and 'w'.
How can I this?

채택된 답변

Wayne King
Wayne King 2012년 6월 8일
Just do
[Pxx2,w] = pwelch(y2);
Or any legal variable name. MATLAB variable names must start with a letter followed by up to 30 letters, digits, or underscores. It is also case sensitive.
  댓글 수: 1
john birt
john birt 2012년 6월 8일
thank you

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by