필터 지우기
필터 지우기

Undefined function or method 'minus' for input arguments of type 'struct'

조회 수: 2 (최근 30일)
aliha wasim
aliha wasim 2016년 6월 28일
편집: Stephen23 2016년 6월 28일
I am working on speech recognition.I have saved the coefficients of 4 audio files in a matrix in mat file. Now I want to compare those with a test audio file but I keep getting on this error Undefined function or method 'minus' for input arguments of type 'struct' . Can someone please guide me about how can I subtract the coefficients of tested audio sample from all the coefficients in mat file. code is below.
d=load ('Database.mat')
% line 1 loads the Database
[s1,fs] = wavread('x1.wav'); % Reading new file x1.wav
B = [1 -0.95];
s1 = filter(B,1,s1);%first order filter
[c]=melcepst(s1,fs);
n=corrcoef(c) ;% Finds the correlation coefficients
n=n(:); % writing all values in one column
n=abs(n);
dtw(1,1) = dist(1,1); % dynamic time wraping technique to see similarity between input signal and data base
dtw(d,n) = min (dtw(d-1, n-1), dtw(d-1, n), dtw(d, n-1)) + dist(d,n);

답변 (1개)

Image Analyst
Image Analyst 2016년 6월 28일
You can't use min like that, like min(num1,num2,num3). It only takes an array so enclose arguments in brackets: min([num1,num2,num3])
dtw(d,n) = min ([dtw(d-1, n-1), dtw(d-1, n), dtw(d, n-1)]) + dist(d,n);
  댓글 수: 2
aliha wasim
aliha wasim 2016년 6월 28일
Thank you. I have corrected my previous mistake in the code but the problem still remains as it is.
Image Analyst
Image Analyst 2016년 6월 28일
We can run the debugger, if you can't do it, if you upload 'database.mat' and 'x1.wav'. I can't run your code without those two files of yours. You can speed things up if you think of these things in advance.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by