How can I limit a set of input data, 6 values, to a min and max point and as an integer
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Andre du Plessis
el 17 de Feb. de 2020
Respondida: KSSV
el 18 de Feb. de 2020
I am writing a piece of code requesting the user to submit 6 integer numbers in the range [1,59]. I want to make it so that if the user submits an value outside the range or a non integer, the code breaks and displays an error message saying invalid numbers chosen.
3 comentarios
Respuesta aceptada
KSSV
el 18 de Feb. de 2020
if min(user)<1 || max(user)>59
error("Check the input")
endif
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!