Info
此问题已关闭。 请重新打开它进行编辑或回答。
Using the while loop function
1 次查看(过去 30 天)
显示 更早的评论
How do i make a while loop to loop five times if the user does not enter the correct input?
0 个评论
回答(1 个)
Pavel Osipov
2019-10-5
编辑:Rik
2019-10-5
fa1=false;
%fa2=true;
k=0;
while k<5
k=k+1;
if fa1==false
disp('you answer is bad, try again. ');
disp('attempt = ');disp(5-k);
else
disp('you answer is good');
break;
end%if
end%while
4 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!