How do I make this mask statement more concise?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
cmcelm
am 4 Dez. 2017
Beantwortet: Image Analyst
am 4 Dez. 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 Kommentare
Akzeptierte Antwort
Image Analyst
am 4 Dez. 2017
Here's one way:
message = 'abc0123456def7890ghi'
message(message >= '0' & message <= '9') = []
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!