[data,times] = fiff_read_raw_segment_times(raw,from,to) Read a specific raw data segment raw - structure returned by fiff_setup_read_raw from - starting time of the segment in seconds to - end time of the segment in seconds sel - optional channel selection vector data - returns the data matrix (channels x samples) times - returns the time values corresponding to the samples (optional)
0001 function [data,times] = fiff_read_raw_segment_times(raw,from,to,sel) 0002 % 0003 % [data,times] = fiff_read_raw_segment_times(raw,from,to) 0004 % 0005 % Read a specific raw data segment 0006 % 0007 % raw - structure returned by fiff_setup_read_raw 0008 % from - starting time of the segment in seconds 0009 % to - end time of the segment in seconds 0010 % sel - optional channel selection vector 0011 % 0012 % data - returns the data matrix (channels x samples) 0013 % times - returns the time values corresponding to the samples (optional) 0014 % 0015 0016 % 0017 % Author : Matti Hamalainen, MGH Martinos Center 0018 % License : BSD 3-clause 0019 % 0020 % Revision 1.3 2006/04/23 15:29:40 msh 0021 % Added MGH to the copyright 0022 % 0023 % Revision 1.2 2006/04/21 14:23:16 msh 0024 % Further improvements in raw data reading 0025 % 0026 % 0027 0028 me='MNE:fiff_read_raw_segment_times'; 0029 0030 if nargin == 3 0031 sel = []; 0032 elseif nargin ~= 4 0033 error(me,'Incorrect number of arguments'); 0034 end 0035 % 0036 % Convert to samples 0037 % 0038 from = floor(from*raw.info.sfreq); 0039 to = ceil(to*raw.info.sfreq); 0040 % 0041 % Read it 0042 % 0043 [ data, times ] = fiff_read_raw_segment(raw,from,to,sel); 0044 0045 return; 0046 0047 end 0048