Is it possible to assign multiple variables to one number?
    45 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Shawn Simon
 el 4 de Nov. de 2015
  
    
    
    
    
    Comentada: Pedro Cabrera Santana
 el 13 de Jun. de 2023
            For example, is there a much more efficient way of doing this:
a = 0;
b = 0; 
c = 0;
And so on; essentially, I am trying to set a-z equal to 0. I am just trying to make my script seem less long. Thank you for the help.
0 comentarios
Respuesta aceptada
  Jan
      
      
 el 7 de Nov. de 2015
        If you really have 26 variables with a single charater name 'a' to 'z' which are all scalars, use one vector:
a = zeros(1, 26);
and a(2) instead of b.
0 comentarios
Más respuestas (2)
  Bharath Rangaswamy
    
 el 6 de Nov. de 2015
        Hi Shawn,
There is no way to assign multiple variables to one number.
Best,
Bharath
0 comentarios
Ver también
Categorías
				Más información sobre Whos 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!





