0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 function xmlWriteColIndex(fid, fidb, data, precision)
0016
0017 nrows = size (data, 1);
0018 ncols = size (data, 2);
0019
0020 if nrows ~= 0 & ncols ~=0 & nrows ~= 1 & ncols ~= 1
0021 error ('Either columns or rows must have size 1 or both must be zero');
0022 end
0023
0024 nelem = length (data);
0025
0026 xmlWriteTag (fid, 'ColIndex', ...
0027 xmlAddAttribute ([], 'nelem', sprintf ('%d', nelem)));
0028
0029 if (strcmp(precision, 'BINARY'))
0030 fwrite (fidb, data, 'integer*4');
0031 else
0032 fprintf (fid, '%d\n', data);
0033 end
0034
0035 xmlWriteCloseTag (fid, 'ColIndex');
0036