How do I make this mask statement more concise?
Afficher commentaires plus anciens
I have a problem where I need to remove all numerical characters from a string. I currently have it like this:
message = message(message != '0')
message = message(message != '1')
and so on
I want to condense these into a single statement, but I'm having trouble figuring out how to. How would I go about making this more concise?
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 4 Déc 2017
message = message(~ismember(message, '0123456789'))
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!