"Insufficient number of outputs from right hand side of equal sign to satisfy assignment."
    121 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Mike Suffield
 el 11 de Nov. de 2015
  
    
    
    
    
    Comentada: Sivylla Paraskevopoulou
    
 el 28 de Dic. de 2024
            Hi,
For a university project I'm having to code a K-Means clustering algorithm from scratch. As part of my code I have the following line:
[min, index] = min(NORMS);
On first run through of the code it works fine, but on the second iteration it always brings up the error "Insufficient number of outputs from right hand side of equal sign to satisfy assignment."
After clearing the variables and starting again it works fine, but again only for one iteration of the code.
Anyone have any ideas because I need to put it within a loop!
Cheers :)
2 comentarios
  Daniel Szucs
 el 23 de Oct. de 2016
				If we want it work we just need to write following your example a : "clear min clear index"
before we call in the min function. In that case the code works.
  Sivylla Paraskevopoulou
    
 el 28 de Dic. de 2024
				@Mike Suffield, this is not specific to training your network, but the trainnetwork function is no longer recommended. Use the trainnet function instead.
Respuesta aceptada
  James Tursa
      
      
 el 11 de Nov. de 2015
        You likely have inadvertently created a variable named "min" in your code, which is shadowing the function min. Go find that variable and use a different name.
12 comentarios
Más respuestas (1)
  BHANESH BHADRECHA
      
 el 29 de En. de 2016
        
      Editada: BHANESH BHADRECHA
      
 el 29 de En. de 2016
  
      that is because your output variable name and function name both are same.
for example
[stft, t, f]= stft(x,wlen,nfft);
in above function output variable in left hand side is stft and in right hand side function name is stft also.
so check this type of errors in your code.
or in matlab program you have created a variable which is already inbuilt function name of MATLAB.
Ver también
Categorías
				Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
















