how add characters to sequence?
1 回表示 (過去 30 日間)
古いコメントを表示
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 件)
Andrei Bobrov
2012 年 2 月 27 日
out = regexprep('qwe hj l',' ',' ')
or
a = regexp('qwe hj l',' ','split');
out = cell2mat(cellfun(@(x)[x,blanks(length(x))],a,'un',0))
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!