Effacer les filtres
Effacer les filtres

can you please tell me how to remove any special characters from a string in MATLAB?

7 vues (au cours des 30 derniers jours)
tina jain
tina jain le 12 Mai 2015
Commenté : Walter Roberson le 12 Mai 2015
special characters include anything else from alphabets(a-z) and(A-Z)

Réponses (1)

Stalin Samuel
Stalin Samuel le 12 Mai 2015
%for example
s='matlab@123'
s(isletter(s)==0)=[];
  2 commentaires
tina jain
tina jain le 12 Mai 2015
I want to remove special characters.This is not what I want
Walter Roberson
Walter Roberson le 12 Mai 2015
It is what you defined. isletter() is true only for a-z and A-Z . If you want to leave digits alone then you need to define digits as being not "special characters"

Connectez-vous pour commenter.

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!

Translated by