Home > data-analysis > manip > mark_ranges.m

mark_ranges

PURPOSE ^

SYNOPSIS ^

function log = mark_ranges(timecol, ranges)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function log = mark_ranges(timecol, ranges)
0002 timecol = timecol(:,1);
0003 sr = mode(diff(timecol(1:10)));
0004 ranges(:,2) = ranges(:,2) - sr;
0005 ranges(:,1) = ranges(:,1) - 0.0001;
0006 ranges(:,2) = ranges(:,2) + 0.0001;
0007 logs = zeros(size(timecol, 1), size(ranges, 1));
0008 for r = 1:size(ranges, 1);
0009     logs(:,r) = timecol >= ranges(r,1) & timecol <= ranges(r,2);
0010 end
0011 log = any(logs, 2);
0012 end

Generated on Wed 24-May-2017 00:00:56 by m2html © 2005