Is it possible to assign multiple variables to one number?
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (2)
Walter Roberson
le 6 Nov 2015
[a, b, c] = deal(0);
2 commentaires
Ale Kat
le 21 Juil 2019
excellent
Pedro Cabrera Santana
le 13 Juin 2023
great answer!
Bharath Rangaswamy
le 6 Nov 2015
0 votes
Hi Shawn,
There is no way to assign multiple variables to one number.
Best,
Bharath
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!