Clear Filters
Clear Filters

Use regexp in Matlab to sperate a set of string variable

2 views (last 30 days)
I have a set of string data such as :
'H3F3A /// LOC440926'
'GTF2I /// GTF2IP1 /// LOC100093631'
'TMEM189 /// TMEM189-UBE2V1 /// UBE2V1'
'RNPEP /// TMEM189 /// TMEM189-UBE2V1 /// UBE2V1'
I want to operate them according to this symbol "///". I used this expression
genesymbolzSplit = regexp(geneSymbol,'(\w*)\W*','tokens');
It works for the first two rows. Unfortunately, It does not work for the other for example'
TMEM189-UBE2V1' should be one string value but it comes as two
'TMEM189' 'UBE2V1'
Could you help me to sort out the problem I will grateful to you

Accepted Answer

Jan
Jan on 24 Jan 2016
What about:
c = {'H3F3A /// LOC440926', ...
'GTF2I /// GTF2IP1 /// LOC100093631'};
s = regexp(c, '///', 'split')

More Answers (0)

Categories

Find more on Numeric Types in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!