Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to do a while loop

1 次查看(过去 30 天)
Riri
Riri 2014-1-20
关闭: MATLAB Answer Bot 2021-8-20
I have to combined a for loop and a while loop

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2014-1-20
test=0;
while test==0
test=input('You are in a while loop. Press 1 to exit the loop and 0 to stay');
%your code
end
  3 个评论
Image Analyst
Image Analyst 2014-1-20
Well, why did you say "You are in a while loop" when you didn't even have any while loops at all. All you had were for loops. So why did you say that?
Riri
Riri 2014-1-21
Nwm I just firgured it out thank you tho

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by