Matlab - verify if a string have any number
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 7 Août 2014
Modifié(e) : Azzi Abdelmalek
le 7 Août 2014
str='scramble3'
idx=~isempty(regexp(str,'\d','match'))
%or
idx=any(ismember(str,'0':'9'))
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!