How to enter an input in an active 'while' loop?
显示 更早的评论
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
采纳的回答
更多回答(2 个)
Oleg Komarov
2011-7-4
x = 1;
while x == 1
x = input('Value for x: ');
end
David Mason
2011-7-9
0 个投票
1 个评论
Oleg Komarov
2011-7-9
instead of x == 1 you can verify that the button has been pushed.
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!