Use regexp in Matlab to sperate a set of string variable

2 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numeric Types 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by