Creating a new variable in a loop automatically. Please help!

3 visualizaciones (últimos 30 días)
Steve
Steve el 19 de Abr. de 2014
Comentada: Steve el 19 de Abr. de 2014
I need to create a new variable every time the loop occurs. I am pretty new to matlab please help!
I need the variable to change automatically each time the conditions are met and the variable is stored. (Yaxisvarible1, Yaxisvariable2, and so on). Thanks in advance.

Respuesta aceptada

lvn
lvn el 19 de Abr. de 2014
You can use the eval function to create such variables. However this practice is not recommended and can almost always be circumvented by other and better data representation (e.g. vectors/ structures/cells, etc..)
  1 comentario
Steve
Steve el 19 de Abr. de 2014
Thanks to both of you! This link explains the alternative methods a bit better.

Iniciar sesión para comentar.

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 19 de Abr. de 2014

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!

Translated by