Home > eeg > egis > net_utils > wt_fragger_hdr.m

wt_fragger_hdr

PURPOSE ^

status = wt_fragger_hdr(fid,header_array,EventCodes);

SYNOPSIS ^

function status = wt_fragger_hdr(fid,header_array,EventCodes);

DESCRIPTION ^

status = wt_fragger_hdr(fid,header_array,EventCodes);

write a header to a new NSFragger file

fid = open new file
header_array = header
EventCodes = event codes
 
 Release 1.0 2/9/97 R.S. 
 
 Note: This code was developed on my own time, for your lab use.  
       Please don't redistribute on your own without asking me.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function status = wt_fragger_hdr(fid,header_array,EventCodes);
0002 %status = wt_fragger_hdr(fid,header_array,EventCodes);
0003 %
0004 %write a header to a new NSFragger file
0005 %
0006 %fid = open new file
0007 %header_array = header
0008 %EventCodes = event codes
0009 %
0010 % Release 1.0 2/9/97 R.S.
0011 %
0012 % Note: This code was developed on my own time, for your lab use.
0013 %       Please don't redistribute on your own without asking me.
0014 %
0015 if nargin < 3
0016      error('insufficient input arguments');
0017 end
0018 if fid < 1
0019     error('you have provided an invalid file');
0020 end;
0021 if size(header_array,2) ~= 15
0022     error('size of header array is incorrect');
0023 end;
0024 fwrite(fid,header_array(1),'int32');
0025 fwrite(fid,header_array(2),'int16');
0026 fwrite(fid,header_array(3),'int16');
0027 fwrite(fid,header_array(4),'int16');
0028 fwrite(fid,header_array(5),'int16');
0029 fwrite(fid,header_array(6),'int16');
0030 fwrite(fid,header_array(7),'int32');
0031 fwrite(fid,header_array(8),'int16');
0032 fwrite(fid,header_array(9),'int16');
0033 fwrite(fid,header_array(10),'int16');
0034 fwrite(fid,header_array(11),'int16');
0035 fwrite(fid,header_array(12),'int16');
0036 fwrite(fid,header_array(13),'int16');
0037 fwrite(fid,header_array(14),'int32');
0038 fwrite(fid,header_array(15),'int16');
0039 for i = 1:header_array(15)
0040     fread(fid,EventCodes(i),'char');
0041 end;
0042 status =1;
0043

Generated on Sun 19-May-2019 04:00:51 by m2html © 2003