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 Formatsee “Numeric Array and Character Array Data Element Formats” onpage 1-15.Figure 1-12: Example Cell Array Data ElementBytes 1 2 3 4 5 6 7 8TagmiMATRIX168UndefinedmiUINT32 8miINT320mxCELL_CLASS1 2U n d e f i n e d8ArrayFlagsDimensionsArray1miINT8CPaddingArray NamemiMATRIX56miUINT32 8168 bytesUndefined1miINT320mxDOUBLE_CLASS2 3miINT8miUINT8 6AU n d e f i n e d8PaddingNumeric array1 4 2 5 3 6 PaddingmiMATRIX56CellsmiUINT32 8Undefined1miINT320mxDOUBLE_CLASS2 3miINT8BU n d e f i n e d8PaddingNumeric arraymiUINT8 67 10 8 11 9 12 Padding1-28

Level 5 MATLAB Array Data Element FormatsStructure MAT-File Data Element FormatA MAT-file data element representing a MATLAB structure is composed of sixsubelements. Table 1-6 lists the subelements in the order in which they appearin the data element. The table lists the values of the Data Type and Number ofBytes fields of the tag for each subelement.Table 1-6: Structure Subelements with Tag DataSubelements Data Type Number of BytesArray Flags miUINT32 2*size-of-Data-Type (8 bytes)Dimensions Array miINT32 number-of-dimensions*size-of-Data-TypeArray Name miINT8 number-of-characters*size-of-Data-TypeField Name Length miINT32 size-of-Data-Type (4 bytes)Field Names miINT8 number-of-fields*Field-Name-LengthFieldsEach field is written in place as an array. Fields are written incolumn order.Array Flags SubelementThis subelement identifies the MATLAB array type (class) represented by thedata element and provides other information about the array. Figure 1-13shows the Array Flags format. The Array Flags subelement is common to allarray types.Figure 1-13: Array Flags FormatBytes 1 2 3 4 5 6 7 8Undefined Flags Class U n d e f i n e dFlags. See “Flags” on page 1-16 for more information.Class. This field contains a value that identifies the MATLAB data typerepresented by the data element. For structures, Class contains the value 2(mxSTRUCT_CLASS). For more information, see “Class” on page 1-16.1-29

Level 5 <strong>MAT</strong>LAB Array Data Element <strong>Format</strong>sStructure <strong>MAT</strong>-<strong>File</strong> Data Element <strong>Format</strong>A <strong>MAT</strong>-file data element representing a <strong>MAT</strong>LAB structure is composed of sixsubelements. Table 1-6 lists the subelements in the order in which they appearin the data element. The table lists the values of the Data Type and Number ofBytes fields of the tag for each subelement.Table 1-6: Structure Subelements with Tag DataSubelements Data Type Number of BytesArray Flags miUINT32 2*size-of-Data-Type (8 bytes)Dimensions Array miINT32 number-of-dimensions*size-of-Data-TypeArray Name miINT8 number-of-characters*size-of-Data-TypeField Name Length miINT32 size-of-Data-Type (4 bytes)Field Names miINT8 number-of-fields*Field-Name-LengthFieldsEach field is written in place as an array. Fields are written incolumn order.Array Flags SubelementThis subelement identifies the <strong>MAT</strong>LAB array type (class) represented by thedata element and provides other information about the array. Figure 1-13shows the Array Flags format. The Array Flags subelement is common to allarray types.Figure 1-13: Array Flags <strong>Format</strong>Bytes 1 2 3 4 5 6 7 8Undefined Flags Class U n d e f i n e dFlags. See “Flags” on page 1-16 for more information.Class. This field contains a value that identifies the <strong>MAT</strong>LAB data typerepresented by the data element. For structures, Class contains the value 2(mxSTRUCT_CLASS). For more information, see “Class” on page 1-16.1-29

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

Saved successfully!

Ooh no, something went wrong!