Looping prompt till answered correctly

1 Ansicht (letzte 30 Tage)
Kalpha.mc
Kalpha.mc am 12 Sep. 2020
Beantwortet: Walter Roberson am 12 Sep. 2020
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.

Antworten (1)

Walter Roberson
Walter Roberson am 12 Sep. 2020
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

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by