is there a function in matlab that creates a binary repetition coder ?
Show older comments
for example when i enter a sequence 0010110 ;when n=3
the result will be 000000111000111111000
Accepted Answer
More Answers (1)
Nasser M. Abbasi
on 25 Dec 2012
You did not say what is the class of 0010110, so I assume cell array.
r = {'0' '0' '1' '0' '1' '1' '0'};
n = 3;
reshape(repmat(r,n,1),1,n*numel(r))'
ans =
'0'
'0'
'0'
'0'
'0'
'0'
'1'
'1'
'1'
'0'
'0'
'0'
'1'
'1'
'1'
'1'
'1'
'1'
'0'
'0'
'0'
This is a cell. Now you can do with it any conversion you want.
--Nasser
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!