MAT-File Format - SERC

MAT-File Format - SERC MAT-File Format - SERC

serc.iisc.ernet.in
from serc.iisc.ernet.in More from this publisher
13.07.2015 Views

1 MAT-File FormatData Element FormatEach data element begins with an 8-byte tag followed immediately by the datain the element. Figure 1-2 shows this format. (MATLAB also supports acompressed data element format. See page 1-10 for more information.)Figure 1-2: MAT-File Data Element FormatBytes 1 2 3 4 5 6 7 8Data TypeNumber of BytesTagVariable sizeDataThis section covers the following topics:• “The Tag Field” on page 1-8• “The Data Field” on page 1-10• “Small Data Element Format” on page 1-10• “Example Data Element” on page 1-11The Tag FieldThe 8-byte data element tag is composed of two, 32-bit fields:• Data Type• Number of BytesData Type. The Data Type field specifies how the data in the element should beinterpreted, that is, its size and format. The MAT-file format supports manydata types including signed and unsigned, 8-bit, 16-bit, 32-bit, and 64-bit datatypes, a special data type that represents MATLAB arrays, Unicode encodedcharacter data, and data stored in compressed format. Table 1-1 lists all thesedata types with the values used to specify them. The table also includes1-8

Level 5 MAT-File Formatsymbols that are used to represent these data types in the examples in thisdocument.Table 1-1: MAT-File Data TypesValue Symbol MAT-File Data Type1 miINT8 8 bit, signed2 miUINT8 8 bit, unsigned3 miINT16 16-bit, signed4 miUINT16 16-bit, unsigned5 miINT32 32-bit, signed6 miUINT32 32-bit, unsigned7 miSINGLE IEEE 754 single format8 -- Reserved9 miDOUBLE IEEE 754 double format10 -- Reserved11 -- Reserved12 miINT64 64-bit, signed13 miUINT64 64-bit, unsigned14 miMATRIX MATLAB array15 miCOMPRESSED Compressed Data16 miUTF8 Unicode UTF-8 Encoded Character Data17 miUTF16 Unicode UTF-16 Encoded Character Data18 miUTF32 Unicode UTF-32 Encoded Character DataThe UTF-16 and UTF-32 encodings are in the byte order specified by the EndianIndicator (See “Header Flag Fields” on page 1-7). UTF-8 is byte order neutral.1-9

1 <strong>MAT</strong>-<strong>File</strong> <strong>Format</strong>Data Element <strong>Format</strong>Each data element begins with an 8-byte tag followed immediately by the datain the element. Figure 1-2 shows this format. (<strong>MAT</strong>LAB also supports acompressed data element format. See page 1-10 for more information.)Figure 1-2: <strong>MAT</strong>-<strong>File</strong> Data Element <strong>Format</strong>Bytes 1 2 3 4 5 6 7 8Data TypeNumber of BytesTagVariable sizeDataThis section covers the following topics:• “The Tag Field” on page 1-8• “The Data Field” on page 1-10• “Small Data Element <strong>Format</strong>” on page 1-10• “Example Data Element” on page 1-11The Tag FieldThe 8-byte data element tag is composed of two, 32-bit fields:• Data Type• Number of BytesData Type. The Data Type field specifies how the data in the element should beinterpreted, that is, its size and format. The <strong>MAT</strong>-file format supports manydata types including signed and unsigned, 8-bit, 16-bit, 32-bit, and 64-bit datatypes, a special data type that represents <strong>MAT</strong>LAB arrays, Unicode encodedcharacter data, and data stored in compressed format. Table 1-1 lists all thesedata types with the values used to specify them. The table also includes1-8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!