0001 function status = wt_fragger_hdr(fid,header_array,EventCodes);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
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