Looping prompt till answered correctly
1 回表示 (過去 30 日間)
古いコメントを表示
I need to set a limit so the number that is inputed can not be 9 or under. with a loop that will display the prompt again if you don't answer correctly. If the number is 10 or over it will let you continue.
0 件のコメント
回答 (1 件)
Walter Roberson
2020 年 9 月 12 日
while true
prompt for input
if the input was numeric and the input was scalar and the input is not complex valued and the input is in range
break
end
end
0 件のコメント
参考
カテゴリ
Help Center および 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!