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

Answers (1)

%for example
s='matlab@123'
s(isletter(s)==0)=[];

2 Comments

I want to remove special characters.This is not what I want
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"

Sign in to comment.

Categories

Asked:

on 12 May 2015

Commented:

on 12 May 2015

Community Treasure Hunt

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

Start Hunting!