How to enter an input in an active 'while' loop?
Mostrar comentarios más antiguos
Hi everybody,
I want to 'break' a 'while' loop when an input gets a specific value. Unfortunately, I don't know why when I change the input value, (when 'while' loop is executing), the 'while' loop doesn't recognize! this change?
Please guide me..
Thanks, David
Respuesta aceptada
Más respuestas (2)
Oleg Komarov
el 4 de Jul. de 2011
x = 1;
while x == 1
x = input('Value for x: ');
end
David Mason
el 9 de Jul. de 2011
0 votos
1 comentario
Oleg Komarov
el 9 de Jul. de 2011
instead of x == 1 you can verify that the button has been pushed.
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!