필터 지우기
필터 지우기

error in program

조회 수: 1 (최근 30일)
Padma
Padma 2011년 11월 16일
HI
>>[FileName,PathName]=uigetfile('sampleleft.wav');
>> PathOrig=sprintf('%s%s',PathName,FileName);
>> [x,fs]=wavread(PathOrig);
>> [FileName1,PathName1]=uigetfile('sampleright.wav');
>> PathOrig1=sprintf('%s%s',PathName1,FileName1);
>> [y,fs]=wavread(PathOrig1);
>> cccorrelation=xcorr(y,x);
Error using xcorr>parse_y (line 314)
B must be a vector (min(size(B))==1).
Error in xcorr>parseinput (line 290)
maxlag = parse_y(y,m,xIsMatrix,maxlag);
Error in xcorr (line 48)
[xIsMatrix,autoFlag,maxlag,scaleType] = parseinput(x,varargin{:});
could you please tell me how to handle this error?
thanks in advance

답변 (3개)

Wayne King
Wayne King 2011년 11월 16일
Something is wrong with your x vector from
[x,fs]=wavread(PathOrig);
Please show us what is returned if you enter
>>whos x
  댓글 수: 2
Padma
Padma 2011년 11월 16일
Name Size Bytes Class Attributes
x 440320x2 7045120 double
Padma
Padma 2011년 11월 16일
it showed the same for y also

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


Jan
Jan 2011년 11월 16일
It seems like x is empty. Please try this:
[FileName, PathName] = uigetfile('sampleleft.wav');
PathOrig = fullfile(PathName, FileName);
[x, fs1] = wavread(PathOrig);
[FileName1, PathName1] = uigetfile('sampleright.wav');
PathOrig1 = fullfile(PathName1,FileName1);
[y,fs] = wavread(PathOrig1);
disp(size(x));
disp(size(y));
  댓글 수: 1
Padma
Padma 2011년 11월 16일
i tried display, it gave 440320 2 for both x and y

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


Walter Roberson
Walter Roberson 2011년 11월 16일
Your x and y are two channels -- and that means they are not vectors. You need to correlate one channel against one channel.

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by