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

my_rle

PURPOSE ^

method to do run length encoding on matrix

SYNOPSIS ^

function rlem = my_rle(m)

DESCRIPTION ^

 method to do run length encoding on matrix

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function rlem = my_rle(m)
0002 % method to do run length encoding on matrix
0003 %
0004 % $Id$
0005 
0006 m = m(:);
0007 dps = [1; find(diff(m))+1];
0008 rlem = [diff([dps; length(m)+1]), m(dps)];

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