How do I make this mask statement more concise?

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?

 Respuesta aceptada

Image Analyst
Image Analyst el 4 de Dic. de 2017
Here's one way:
message = 'abc0123456def7890ghi'
message(message >= '0' & message <= '9') = []

Más respuestas (1)

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 4 de Dic. de 2017

Respondida:

el 4 de Dic. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by