how add characters to sequence?
Mostrar comentarios más antiguos
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
1 comentario
huda nawaf
el 27 de Feb. de 2012
Respuestas (1)
Andrei Bobrov
el 27 de Feb. de 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 comentarios
huda nawaf
el 27 de Feb. de 2012
Andrei Bobrov
el 27 de Feb. de 2012
regexp('qwe hj l',' ')
Categorías
Más información sobre Test Model Components en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!