Index in position 2 is invalid. Array indices must be positive integers or logical values.
    3 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
I have a problem. I want to do a speech command recognition, 
I am trying to do this by example : https://www.mathworks.com/help/deeplearning/examples/deep-learning-speech-recognition.html
This error occurs when I try to make spectograms with my own data. I don't know what format this voice data should be. I recorded them using audacity and exported them as: Mono, 32-bit folat with a frequency of 16000 HZ each 'yes' is 1 length one second. I don't know where to change or what format the recording should be to load it. I don't know if this is a mistake in the code or badly saved sound files.
Index in position 2 is invalid. Array indices must be positive integers or logical values.
Error in speechSpectrograms (line 41)
    X(:,ind,1,i) = spec; 
The attachment added is the code from speechSpectrograms
5 commentaires
  Star Strider
      
      
 le 18 Déc 2019
				The ‘ind’ vector must  only contan integers greater than 0 to use it as an index.  
Réponses (1)
  Guillaume
      
      
 le 18 Déc 2019
        The error message is clear, the index in position two is invalid because it contains either non-integer values or values less than one. 
The index in position two is the ind variable, so look inside that variable and see what the values are. They're going to be integer due to the way you construct ind, but if left is 0 or negative, then some ind values will indeed be invalid.
You can then work backward throught the code to find why left is less than 1. Without any of your inputs it's not something we can answer. Possible reason at first glance is that size(spec, 2) is greater than numHops.
By the way, isn't spec a vector? In which case, numel(spec) would be simpler and safer than size(spec, 2).
0 commentaires
Voir également
Catégories
				En savoir plus sur Speech Recognition dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!