MATLAB: Matlab – verify if a string have any number

string

hi everyone;
I have a string and i need to verify if there are any number.
for example
str='scramble3'
and i need a answer like, True or 1(to yes) and False or 0(to no)
Thanks

Best Answer

you can use the function regexp.
example:
~isempty(regexp('scramble3','\d'))
would return a 1.
if you leave out the isempty check then it'll return 9 which is the index position of the number.