0001 function fiff_write_double(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
0025
0026
0027 me='MNE:fiff_write_double';
0028
0029 if nargin ~= 3
0030 error(me,'Incorrect number of arguments');
0031 end
0032
0033 FIFFT_DOUBLE=5;
0034 FIFFV_NEXT_SEQ=0;
0035 nel=numel(data);
0036 datasize=nel*8;
0037 count = fwrite(fid,int32(kind),'int32');
0038 if count ~= 1
0039 error(me,'write failed');
0040 end
0041 count = fwrite(fid,int32(FIFFT_DOUBLE),'int32');
0042 if count ~= 1
0043 error(me,'write failed');
0044 end
0045 count = fwrite(fid,int32(datasize),'int32');
0046 if count ~= 1
0047 error(me,'write failed');
0048 end
0049 count = fwrite(fid,int32(FIFFV_NEXT_SEQ),'int32');
0050 if count ~= 1
0051 error(me,'write failed');
0052 end
0053 count = fwrite(fid,double(data),'double');
0054 if count ~= nel
0055 error(me,'write failed');
0056 end
0057
0058 return;