Changing variable after each loop iteration
Mostrar comentarios más antiguos
Will it be possible to change the variable or assign an new variable after each loop iteration
a=9
while a>0
a=input('Example')
end
I don't want to collect it in an array.
Thank you
1 comentario
Rooy
el 20 de Feb. de 2013
Respuesta aceptada
Más respuestas (1)
Youssef Khmou
el 20 de Feb. de 2013
Yes, you can but your example is not clear using infinite loop and an input each iteration .
for t=1:10
x=t; % each iteration x= t={1,,,,10} x(final)=10
end
Categorías
Más información sobre Loops and Conditional Statements 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!