Is it possible to assign multiple variables to one number?
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (2)
Walter Roberson
il 6 Nov 2015
[a, b, c] = deal(0);
Bharath Rangaswamy
il 6 Nov 2015
0 voti
Hi Shawn,
There is no way to assign multiple variables to one number.
Best,
Bharath
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!