function to do run length decoding $Id$
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