


LEADINGEDGES Marks 0 -> NONZERO transitions along data columns. EDGEMARKERS = LEADINGEDGES(DATA) takes an M x N matrix DATA and returns a M x N matrix EDGEMARKERS, containing a '1' in each location that corresponds to the first nonzero value in a DATA column following one or more zeros above it in the same column. If the first row of any DATA column contains a nonzero value, it will be marked in EDGEMARKERS. DATA can be a matrix of type double, uint8, or logical; in all of these cases, EDGEMARKERS is of type logical. DATA should not contain NaN values.


0001 function markers = leadingedges(data) 0002 %LEADINGEDGES Marks 0 -> NONZERO transitions along data columns. 0003 % EDGEMARKERS = LEADINGEDGES(DATA) takes an M x N matrix DATA and 0004 % returns a M x N matrix EDGEMARKERS, containing a '1' in each location 0005 % that corresponds to the first nonzero value in a DATA column following 0006 % one or more zeros above it in the same column. If the first row of 0007 % any DATA column contains a nonzero value, it will be marked in 0008 % EDGEMARKERS. 0009 % 0010 % DATA can be a matrix of type double, uint8, or logical; in all of 0011 % these cases, EDGEMARKERS is of type logical. DATA should not contain 0012 % NaN values. 0013 0014 if (issparse(data)), error('Sparse matrices can not be used with LEADINGEDGES.'); end 0015 0016 markers = CORE_leadingedges(data);