Home > eeg > egis > egis_file_utils > get_cell_offsets.m

get_cell_offsets

PURPOSE ^

function [cell_data_offsets]=get_cell_offsets(fhdr, chdr)

SYNOPSIS ^

function [cell_data_offsets]=get_cell_offsets(fhdr, chdr)

DESCRIPTION ^

function [cell_data_offsets]=get_cell_offsets(fhdr, chdr)

Returns the index to the beginning of each cell's data

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [cell_data_offsets]=get_cell_offsets(fhdr, chdr)
0002 %function [cell_data_offsets]=get_cell_offsets(fhdr, chdr)
0003 %
0004 %Returns the index to the beginning of each cell's data
0005 %
0006 
0007 %Check HdrVer to see if file is a ses file or ave file
0008 if fhdr(2) == 1
0009   ses_hdr_offsets_v;
0010 else
0011   ave_hdr_offsets_v;
0012 end
0013 
0014 cell_data_offsets = zeros(1,fhdr(NCells));
0015 cum_cell_sizes = 0;
0016 
0017 for c = 1:fhdr(NCells)
0018     cell_data_offsets(c) = fhdr(LHeader) + cum_cell_sizes;
0019     cum_cell_sizes = cum_cell_sizes + chdr(c,NObs)*chdr(c,NPoints)*fhdr(NChan)*2;
0020 end

Generated on Wed 20-Mar-2019 04:00:51 by m2html © 2003