0001 function fiff_write_dau16(fid, kind, data)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 me = 'MNE:fiff_write_dau16';
0022
0023 if nargin ~= 3
0024 error(me, 'Incorrect number of arguments');
0025 end
0026
0027 FIFFT_DAU_PACK16 = 16;
0028 FIFFV_NEXT_SEQ = 0;
0029 nel = numel(data);
0030 datasize = nel * 2;
0031 count = fwrite(fid, int32(kind), 'int32');
0032 if count ~= 1
0033 error(me, 'write failed');
0034 end
0035 count = fwrite(fid, int32(FIFFT_DAU_PACK16), 'int32');
0036 if count ~= 1
0037 error(me, 'write failed');
0038 end
0039 count = fwrite(fid, int32(datasize), 'int32');
0040 if count ~= 1
0041 error(me, 'write failed');
0042 end
0043 count = fwrite(fid, int32(FIFFV_NEXT_SEQ), 'int32');
0044 if count ~= 1
0045 error(me, 'write failed');
0046 end
0047 count = fwrite(fid, int16(data), 'int16');
0048 if count ~= nel
0049 error(me, 'write failed');
0050 end
0051
0052 return