% rleenc - Run Length Encoding Algorithm
% rleenc - function performs run length encoding for binary input sequence.
% ins - input sequence
% enc - encoded output
% For example, x=randint(1,10,[0 1]);
% Will give you a random sequence
% having only zeros and ones.
% developed by Suraj Kamya
% contact me: firstname.lastname@example.org
The function randint is in the Communications toolbox, so it may not be the best example.
Also the rleenc function has some issues:
>> x = [0 1 0 0];
Dear it will produce the vector having zeros and ones. Please re-check it will not produce empty vector.
produce a empty Vector