Home > atmlab > arts > xml > xmlWriteColIndex.m

xmlWriteColIndex

PURPOSE ^

Writes an ColIndex vector to an XML file.

SYNOPSIS ^

function xmlWriteColIndex(fid, fidb, data, precision)

DESCRIPTION ^

 Writes an ColIndex vector to an XML file.

    Internal function that should never be called directly.
    Use *xmlStore* instead.

 FORMAT   xmlWriteColIndex(fid, fidb, data)

 IN    fid    File descriptor
 IN    fidb   File descriptor for binary file
 IN    data   Index Vector
 IN    precision  Precision for floats

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

xmlWriteColIndex.m

SOURCE CODE ^

0001 % Writes an ColIndex vector to an XML file.
0002 %
0003 %    Internal function that should never be called directly.
0004 %    Use *xmlStore* instead.
0005 %
0006 % FORMAT   xmlWriteColIndex(fid, fidb, data)
0007 %
0008 % IN    fid    File descriptor
0009 % IN    fidb   File descriptor for binary file
0010 % IN    data   Index Vector
0011 % IN    precision  Precision for floats
0012 
0013 % 2003-06-18  Created by Oliver Lemke.
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

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005