% 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: email@example.com
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
Create scripts with code, output, and formatted text in a single executable document.