Home > vbmeg > external > mne > fiff_write_string.m

fiff_write_string

PURPOSE ^

SYNOPSIS ^

function fiff_write_string(fid,kind,data)

DESCRIPTION ^

 fiff_write_string(fid,kind,data)
 
 Writes a string tag

     fid           An open fif file descriptor
     kind          The tag kind
     data          The string data to write

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fiff_write_string(fid,kind,data)
0002 %
0003 % fiff_write_string(fid,kind,data)
0004 %
0005 % Writes a string tag
0006 %
0007 %     fid           An open fif file descriptor
0008 %     kind          The tag kind
0009 %     data          The string data to write
0010 %
0011 
0012 %
0013 %   Author : Matti Hamalainen, MGH Martinos Center
0014 %   License : BSD 3-clause
0015 %
0016 %   Revision 1.2  2006/04/23 15:29:40  msh
0017 %   Added MGH to the copyright
0018 %
0019 %   Revision 1.1  2006/04/10 23:26:54  msh
0020 %   Added fiff reading routines
0021 %
0022 %
0023 
0024 me='MNE:fiff_write_string';
0025 
0026 if nargin ~= 3
0027         error(me,'Incorrect number of arguments');
0028 end
0029 
0030 FIFFT_STRING=10;
0031 FIFFV_NEXT_SEQ=0;
0032 datasize=size(data,2);
0033 count = fwrite(fid,int32(kind),'int32');
0034 if count ~= 1
0035     error(me,'write failed');
0036 end
0037 count = fwrite(fid,int32(FIFFT_STRING),'int32');
0038 if count ~= 1
0039     error(me,'write failed');
0040 end
0041 count = fwrite(fid,int32(datasize),'int32');
0042 if count ~= 1
0043     error(me,'write failed');
0044 end
0045 count = fwrite(fid,int32(FIFFV_NEXT_SEQ),'int32');
0046 if count ~= 1
0047     error(me,'write failed');
0048 end
0049 count = fwrite(fid,data,'uchar');
0050 if count ~= datasize
0051     error(me,'write failed');
0052 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005