% Test for alphabetic characters in a string:
A = isstrprop('abc123def', 'alpha')
A =
1 1 1 0 0 0 1 1 1
% Test for numeric digits in a string:
A = isstrprop('abc123def', 'digit')
A =
0 0 0 1 1 1 0 0 0
% Test for hexadecimal digits in a string:
A = isstrprop('abcd1234efgh', 'xdigit')
A =
1 1 1 1 1 1 1 1 1 1 0 0
% Test for numeric digits in a character array:
A = isstrprop(char([97 98 99 49 50 51 101 102 103]), ...
'digit')
A =
0 0 0 1 1 1 0 0 0
% Test for alphabetic characters in a two-dimensional cell array:
A = isstrprop({'abc123def';'456ghi789'}, 'alpha')
A =
[1x9 logical]
[1x9 logical]
A{:,:}
ans =
1 1 1 0 0 0 1 1 1
0 0 0 1 1 1 0 0 0
% Test for white-space characters in a string:
A = isstrprop(sprintf('a bc\n'), 'wspace')
A =
0 1 0 0 1