Changing variable after each loop iteration
Afficher commentaires plus anciens
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 commentaire
Rooy
le 20 Fév 2013
Réponse acceptée
Plus de réponses (1)
Youssef Khmou
le 20 Fév 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
Catégories
En savoir plus sur Loops and Conditional Statements 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!