How can I set multiple variables to the same initial value efficiently?
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Anteneh Zewdu
el 6 de Dic. de 2018
Comentada: madhan ravi
el 13 de Dic. de 2018
I hate using the following way of defining variables;
a= 5, b=a, c=a, d=a, etc
I have a lot of variable taking the same intial value, how can do it efficiently?
Thanks in advance!
1 comentario
Stephen23
el 6 de Dic. de 2018
"I have a lot of variable taking the same intial value, how can do it efficiently?"
Simple: store your data in one array.
Having "a lot of variables" is a sign that you should be using arrays anyway.
Respuesta aceptada
Más respuestas (1)
Ver también
Categorías
Más información sobre Loops and Conditional Statements 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!