Is it possible to assign multiple variables to one number?
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 6 de Nov. de 2015
[a, b, c] = deal(0);
2 comentarios
Ale Kat
el 21 de Jul. de 2019
excellent
Pedro Cabrera Santana
el 13 de Jun. de 2023
great answer!
Bharath Rangaswamy
el 6 de Nov. de 2015
0 votos
Hi Shawn,
There is no way to assign multiple variables to one number.
Best,
Bharath
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!