Splitting the characters of string

1 次查看(过去 30 天)
Reshma Ravi
Reshma Ravi 2017-5-22
回答: KSSV 2017-5-22
For example I have a string that is, aatcgatcaagtca and I want to split it into four letters each that is,aatc,atcg,tcga,cgat and so on.

回答(1 个)

KSSV
KSSV 2017-5-22
str = 'aatcgatcaagtca' ;
iwant = [str(1:end-3)' str(2:end-2)' str(3:end-1)' str(4:end)'] ;
There could be more elegant way...

类别

Help CenterFile Exchange 中查找有关 Genomics and Next Generation Sequencing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by