How to solve this xy error code?

조회 수: 3 (최근 30일)
Anggit Raudina
Anggit Raudina 2018년 11월 9일
댓글: Walter Roberson 2018년 11월 9일
I am using Matlab R2008a and I type this code:*
>> %mencari nilai PSD dari data suara Odontoceti (Spinner - 2.wav)
[y,fs]=wavread('Spinner - 2.wav');
[pyy,f]=PSD(xy,256,fs,hamming(256),128,'none');
ys = 10*log10(pyy);
figure(1)
plot (f,ys,'k.-')
grid no
xlabel ('Frekuensi (Hz)')
ylabel ('PSD (dB/Hz)')
title ('Spinner 2')
but i got an error code like this:
??? Undefined function or variable 'xy'.
please help me how to solve this. thankyou
  댓글 수: 2
madhan ravi
madhan ravi 2018년 11월 9일
편집: madhan ravi 2018년 11월 9일
Upload .wav file by clicking the paper clip button
Anggit Raudina
Anggit Raudina 2018년 11월 9일
upload to where?

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

답변 (1개)

Walter Roberson
Walter Roberson 2018년 11월 9일
After
[y,fs]=wavread('Spinner - 2.wav');
Add
xy = y(:, 1);
  댓글 수: 2
Anggit Raudina
Anggit Raudina 2018년 11월 9일
I've do it but I got another error code:
??? Error using ==> wavread at 67
Cannot open file.
and the number 67 is
error('wavread:InvalidFile', msg);
Walter Roberson
Walter Roberson 2018년 11월 9일
Please show the output of
D = dir('*.wav');
N = {D.name};
N{:}

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by