% 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
Suraj Kamya (2020). Run Length Encoding (https://www.mathworks.com/matlabcentral/fileexchange/46865-run-length-encoding), MATLAB Central File Exchange. Retrieved .
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
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!