1.0

1.0 | 2 ratings Rate this file 5 Downloads (last 30 days) File Size: 423 Bytes File ID: #19560

RUN LENGTH DECODING

by Shoeb Temrikar

 

12 Apr 2008 (Updated 14 Apr 2008)

returns binary data from run length encoded array

| Watch this File

File Information
Description

returns binary data from run length encoded array
works with run length encoding.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
14 Apr 2008 Duane Hanselman

Not a function. Not vectorized in any way. Here is what the submission contains:
%
% RUN LENGTH DECODING
rle=input('enter run length encoded matrix: ');

% loop to calculate length of binary data matrix
l=0;
for t=2:length(rle)
    l=l+rle(t);
end

a=false(1,l); % preallocate array

a(1)=rle(1);
m=2;n=1;
for i = 2:length(rle)-1
    for j=1:rle(m)
        a(n+1)=a(n); n=n+1;
    end
    m=m+1;a(n)=~a(n);
end
a=double(a); %ignore if u want output matrix as logical
display(a);

14 Apr 2008 fex observer

If this well-known reviewer tells the truth, you should remove this submission.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
coding theory Shoeb Temrikar 22 Oct 2008 09:57:35
information theory Shoeb Temrikar 22 Oct 2008 09:57:35
decoding Shoeb Temrikar 22 Oct 2008 09:57:35
binary data Shoeb Temrikar 22 Oct 2008 09:57:35
length Shoeb Temrikar 22 Oct 2008 09:57:35
array Shoeb Temrikar 22 Oct 2008 09:57:35
communications Shoeb Temrikar 22 Oct 2008 09:57:35
coding Shoeb Temrikar 22 Oct 2008 09:57:35

Contact us at files@mathworks.com