How do I make this mask statement more concise?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
cmcelm
le 4 Déc 2017
Réponse apportée : Image Analyst
le 4 Déc 2017
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?
0 commentaires
Réponse acceptée
Image Analyst
le 4 Déc 2017
Here's one way:
message = 'abc0123456def7890ghi'
message(message >= '0' & message <= '9') = []
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!