phys2cvr.io.load_mat

phys2cvr.io.load_mat(fname, shape=None)[source]

Read files in MATLAB format.

Assumes the existence of a matrix/vector in the mat file, rendered as a numpy.ndarray. If there is more than a matrix, the one with the largest size will be selected.

Parameters:
fnamestr | os.PathLike

Path to the .mat file.

shapeNone | 'square' | 'rectangle'

Shape of matrix, if empty, skip check.

Returns:
mtxnumpy.ndarray

Data matrix.

Raises:
EOFError

If the mat file does not contain matrix or vectors.

ImportError

If pymatreader is not installed or can’t be read.

See also

utils.check_array_dim

Notes

Requires module pymatreader to work.