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

2 次查看(过去 30 天)
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