MAT-File Format - SERC
MAT-File Format - SERC MAT-File Format - SERC
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
- Page 1 and 2: MATLAB®The Language of Technical C
- Page 3: Revision History:June 1999 Online o
- Page 6 and 7: 1 MAT-File FormatIntroductionThis d
- Page 8 and 9: 1 MAT-File FormatLevel 5 MAT-File F
- Page 10 and 11: 1 MAT-File FormatMAT-File Header Fo
- Page 14 and 15: 1 MAT-File FormatFor character data
- Page 17 and 18: Level 5 MAT-File FormatEach variabl
- Page 19 and 20: Level 5 MATLAB Array Data Element F
- Page 21 and 22: Level 5 MATLAB Array Data Element F
- Page 23 and 24: Level 5 MATLAB Array Data Element F
- Page 25 and 26: Level 5 MATLAB Array Data Element F
- Page 27 and 28: Level 5 MATLAB Array Data Element F
- Page 29: Level 5 MATLAB Array Data Element F
- Page 32 and 33: 1 MAT-File Formatsee “Numeric Arr
- Page 34 and 35: 1 MAT-File FormatDimensions Array S
- Page 36 and 37: 1 MAT-File FormatFigure 1-14: Examp
- Page 38 and 39: 1 MAT-File FormatClass. This field
- Page 40 and 41: 1 MAT-File FormatLevel 4 MAT-File F
- Page 42 and 43: 1 MAT-File FormatTable 1-8: Level 4
- Page 44 and 45: 1 MAT-File FormatAgain, we strongly
- Page 46 and 47: IndexHheaderdefined 1-4flag fields
- Page 48: IndexIndex-4
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