Use regexp in Matlab to sperate a set of string variable
1 次查看(过去 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
0 个评论
采纳的回答
Jan
2016-1-24
What about:
c = {'H3F3A /// LOC440926', ...
'GTF2I /// GTF2IP1 /// LOC100093631'};
s = regexp(c, '///', 'split')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!