File Exchange

image thumbnail

Run Length Encoding

version (1.02 KB) by Suraj Kamya
Run Length Encoding - Loss less Coding Technique

1 Download

Updated 05 Jun 2014

View License

% 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.
% enc=rleenc(x);
% developed by Suraj Kamya
% contact me:

Comments and Ratings (4)

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];
>> rleenc(x)
ans =

Suraj Kamya

Dear it will produce the vector having zeros and ones. Please re-check it will not produce empty vector.

x=randint(1,10,[0 1]);

produce a empty Vector

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor