Changing variable after each loop iteration
Ältere Kommentare anzeigen
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 Kommentar
Rooy
am 20 Feb. 2013
Akzeptierte Antwort
Weitere Antworten (1)
Youssef Khmou
am 20 Feb. 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
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!