how add characters to sequence?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
hi, I have this seq. for example qwe hj l
what I need is adding gaps in spaces of this sequence, such qwe---hj--l
I want code do that
many thanks in advance
Risposte (1)
Andrei Bobrov
il 27 Feb 2012
out = regexprep('qwe hj l',' ',' ')
or
a = regexp('qwe hj l',' ','split');
out = cell2mat(cellfun(@(x)[x,blanks(length(x))],a,'un',0))
2 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!