Skip to main content

Module matlab

Module matlab 

Source
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 indicator IM or MI gives the byte order.
mat_encode
Writes a level-5 MAT-file (SciPy’s savemat with format="5"), little-endian, each variable zlib-compressed if compress (SciPy’s do_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.