how to put a limited value for an input ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
how to put a limited value for an input ? for example from (0 to 100) and if the user enter a value out of this range it will be invalid input ?
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 29 Mär. 2013
test=0
while test==0
a=input('enter 0<a<100')
if a>0 & a<100
test=1
end
end
6 Kommentare
Azzi Abdelmalek
am 29 Mär. 2013
add this
if or(min(a)<0, max(a)>100)
display('Error, all values of a should be between 0 and 100')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Hypothesis Tests finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!