Expand description
MATLAB level-5 .mat files (SciPy’s io.loadmat, io.savemat and io.whosmat).
A level-5 file is a 128-byte header (descriptive text, a version and an endian indicator)
followed by data elements, each a tag (type and byte count) and its data padded to 8 bytes;
small elements of at most 4 bytes pack the tag and data into 8 bytes. Each variable is a
miMATRIX element holding array flags (class, complex, logical), dimensions, a name and the
data, or a miCOMPRESSED element holding one zlib-compressed miMATRIX. Numeric data are
stored column-major in any integer or floating type.
Reading supports both byte orders, compression, the numeric, logical, character, sparse, cell and structure classes, and nesting; writing produces little-endian files, optionally compressed. MATLAB objects, function handles and v7.3 (HDF5) files are not supported.
See the book entry Scientific data files.
Enums§
- MatClass
- The MATLAB class of a numeric array.
- MatValue
- A MATLAB value. Arrays are column-major with their MATLAB dimensions (at least two).
Functions§
- mat_
decode - Parses a level-5 MAT-file (SciPy’s
loadmat): the variables in file order, as(name, value)pairs. The header’s endian indicatorIMorMIgives the byte order. - mat_
encode - Writes a level-5 MAT-file (SciPy’s
savematwithformat="5"), little-endian, each variable zlib-compressed ifcompress(SciPy’sdo_compression). - mat_
whos - The names, dimensions and classes of the variables (SciPy’s
whosmat), without keeping their data. - read_
mat_ file - Reads a MAT-file.
- write_
mat_ file - Writes a MAT-file.