if i try 'isnumeric' it doesn't work as i want to. for
isnumeric(1) and isnumeric(a) it returns true..
is there smth similar to isnumber in matlab?
ischar() to test for characters.
See also isfinite() and isnan()
--
"All human knowledge takes the form of interpretation."
-- Walter Benjamin
In your examples, <1> is a numeric constant, and test as numeric.
But <a> is the name of a variable, that probably *contains* a numeric value.
If you try isnumeric('a'), you'll see it returns 0.
Further, a='abc'; isnumeric(a) will return 0,
while b=123; isnumeric(b) will return 1.
But be careful how you have the user enter the text.
If you do, c='123'; isnumeric(c) will return 0, because <c> contains a
string that just happens to be all digits; it is not a number!
Dave