Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
aliha wasim
aliha wasim am 28 Jun. 2016
Bearbeitet: Stephen23 am 28 Jun. 2016
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);

Antworten (1)

Image Analyst
Image Analyst am 28 Jun. 2016
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 Kommentare
aliha wasim
aliha wasim am 28 Jun. 2016
Thank you. I have corrected my previous mistake in the code but the problem still remains as it is.
Image Analyst
Image Analyst am 28 Jun. 2016
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Signal Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by