Hello everyone,
I am currently writing a code that asks the user to enter a number, let's say 1, 2, or 3. However, I would like to include the case that the user accidently enters characters like 'xyz'. Matlab then displays by standard:
Error using inputUndefined function or variable 'xyz'.
What I want Matlab now to do is to just display a message like:
Invalid! Please enter 1, 2, or 3.
How can I do this?
Thanks a lot for your help!
Best Answer