0001 function fiff_write_string(fid,kind,data)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
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