Splitting the characters of string

2 vues (au cours des 30 derniers jours)
Reshma Ravi
Reshma Ravi le 22 Mai 2017
Réponse apportée : KSSV le 22 Mai 2017
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.

Réponses (1)

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

Catégories

En savoir plus sur Genomics and Next Generation Sequencing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by