Home > eeg > egis > misc_utils > read_trial_utility.m

read_trial_utility

PURPOSE ^

trialdata = RD_ONETR_ALLCH(fileid, cell_data_offset, trial_num, nchan, npoints)

SYNOPSIS ^

function trialdata = read_trial_utility(fid, cell_data_offset, trial_num, nchan, npoints)

DESCRIPTION ^

 trialdata = RD_ONETR_ALLCH(fileid, cell_data_offset, trial_num, nchan, npoints)

   Reads the raw (untransformed) data from all channels for a single trial 
   from a single cell in the EGIS session file referred to by the file_id.

   Returns channels in columns

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function trialdata = read_trial_utility(fid, cell_data_offset, trial_num, nchan, npoints)
0002 % trialdata = RD_ONETR_ALLCH(fileid, cell_data_offset, trial_num, nchan, npoints)
0003 %
0004 %   Reads the raw (untransformed) data from all channels for a single trial
0005 %   from a single cell in the EGIS session file referred to by the file_id.
0006 %
0007 %   Returns channels in columns
0008 
0009 % Modification history:
0010 %
0011 %  2/15/95 PJ -- started work on module
0012 %
0013 
0014 trial_offset = cell_data_offset + (trial_num-1)*nchan*npoints*2;
0015 
0016 fseek(fid, trial_offset, 'bof');
0017 
0018 trialdata = fread(fid, [nchan, npoints],'int16');
0019 trialdata = trialdata';

Generated on Fri 22-Mar-2019 04:00:52 by m2html © 2003