MATLAB: Isn’t the function “isstrprop” not working properly for “alphnum” type argument

alphanumericisstrprop

I am trying to determine if an input is alphanumeric and I ran into this strange issue. For example, let's say I have the following:
userinput =
28
K>> isstrprop(userinput, 'alphanum')
ans =
0
However, when I change the userinput to 48, I get a different result:
userinput =
48
K>> isstrprop(userinput, 'alphanum')
ans =
1
My question is why does the isstrprop function considers 48 as an alphanumeric argument when it thinks 28 is not an alphanumeric argument? Thank you.

Best Answer

MATLAB classifies the elements of the str input according to the Unicode® definition of the specified category. If the numeric value of an element in the input array falls within the range that defines a Unicode character category, then this element is classified as being of that category.
28 is the ASCII FS (Field Separator) code, a meaning preserved in Unicode. FS is not alphanumeric.
48 is the ASCII code for '0', a meaning preserved in Unicode. '0' is an alphanumeric.