Home > marsbar > @maroi_matrix > private > my_rld.m

my_rld

PURPOSE ^

function to do run length decoding

SYNOPSIS ^

function mat = my_rld(rlem, dim)

DESCRIPTION ^

 function to do run length decoding 

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mat = my_rld(rlem, dim)
0002 % function to do run length decoding
0003 %
0004 % $Id$
0005 
0006 sz = sum(rlem(:,1));
0007 mat = zeros(sz, 1);
0008 st = 1;
0009 for i = 1:size(rlem, 1)
0010   tm = zeros(rlem(i,1),1) + rlem(i,2);
0011   st2 = st + rlem(i,1);
0012   mat(st:st2-1) = tm;
0013   st = st2;
0014 end

Generated on Wed 11-May-2022 16:26:09 by m2html © 2003-2019