Hello,
I'm working on a project and I'm trying to figure out something and was wondering if someone could help me. I'm asking the user to input positive and non-decimal numbers only. So no strings, no decimals, no negative numbers, no letters, and no blanks.This is my code:
while ( ischar(r) || ischar(c) || isempty(r) || isempty(c)) disp(' ') disp('You have left an answer blank, or entered a non-numeric value. Please, try again.') r = input('enter the next row you wish to explore sire: '); c = input('enter the next column you wish to explore sire: ');
When I run it and input in a letter such as a or b…, my code breaks and an error occurs (the error is Undefined function or variable 'a'.). I tried isletter , but still get the same thing. I would appreciate the help!
Best Answer