hello, I am trying to index an element from an array say
a= [1 2 3;
4 5 6;
7 8 9];
position = input ('input a number: ')
if the user enters a value bigger than the size of array 'a' MATLAB prints the following:
"Index in position 1 exceeds array bounds" and stops.
my question is how do I print ("enter a valid input") and prompt the user to try again.