Home > atmlab > arts > xml > xmlWriteArrayOfArrayOf.m

xmlWriteArrayOfArrayOf

PURPOSE ^

Writes an ArrayOfArray to an XML file.

SYNOPSIS ^

function xmlWriteArrayOfArrayOf(fid, fidb, data, type, precision)

DESCRIPTION ^

 Writes an ArrayOfArray to an XML file.

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

 FORMAT   xmlWriteArrayOfArrayOf(fid, fidb, data, type, precision)

 IN    fid        File descriptor
 IN    fidb       File descriptor for binary file
 IN    data       Vector
 IN    type       Data type as string
 IN    precision  Precision for floats

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

xmlWriteArrayOfArrayOf.m

SOURCE CODE ^

0001 % Writes an ArrayOfArray to an XML file.
0002 %
0003 %    Internal function that should never be called directly.
0004 %    Use *xmlStore* instead.
0005 %
0006 % FORMAT   xmlWriteArrayOfArrayOf(fid, fidb, data, type, precision)
0007 %
0008 % IN    fid        File descriptor
0009 % IN    fidb       File descriptor for binary file
0010 % IN    data       Vector
0011 % IN    type       Data type as string
0012 % IN    precision  Precision for floats
0013 
0014 % 2002-12-16  Created by Oliver Lemke.
0015 
0016 function xmlWriteArrayOfArrayOf(fid, fidb, data, type, precision)
0017 
0018 nrows = size (data, 1);
0019 ncols = size (data, 2);
0020 
0021 if nrows ~= 0 && ncols ~=0 && nrows ~= 1 && ncols ~= 1
0022   error ('Either columns or rows must have size 1 or both must be zero');
0023 end
0024 
0025 nelem = length (data);
0026 
0027 attrlist = xmlAddAttribute ([], 'type', sprintf ('ArrayOf%s', type));
0028 attrlist = xmlAddAttribute (attrlist, 'nelem', sprintf ('%d', nelem));
0029 xmlWriteTag (fid, 'Array', attrlist);
0030 for i = 1:nelem
0031   xmlWriteArrayOf (fid, fidb, data{i}, type, precision);
0032 end
0033 
0034 xmlWriteCloseTag (fid, 'Array');
0035

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