MATReader class

Reader for MATLAB .mat files (v7.3 only)

This class provides a high-level interface for reading MATLAB v7.3 .mat files, which use HDF5 as the underlying storage format.

Supported: MATLAB v7.3 (HDF5-based) files Not supported: MATLAB v5, v6, v7 (Level 5 MAT-file format)

Example:

// Read a specific variable
final data = await MATReader.readVariable('data.mat', 'myarray');

// Read all variables
final allVars = await MATReader.readAll('data.mat');
print('Variables: ${allVars.keys}');

// List variables without reading
final varNames = await MATReader.listVariables('data.mat');
Implemented types

Constructors

MATReader()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String path, {Map<String, dynamic>? options}) Future<DataFrame>
Reads data from the specified path and returns a DataFrame.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getVariableInfo(String path, String variableName) Future<MatlabVariableInfo>
Get information about a specific variable
inspect(String path) Future<Map<String, dynamic>>
Inspect the file and return summary information
isMatlabFile(String path) Future<bool>
Check if a file is a MATLAB v7.3 file
listVariables(String path) Future<List<String>>
List all MATLAB variables in the file
readAll(String path) Future<Map<String, dynamic>>
Read all MATLAB variables in the file
readAsDataFrame(String path, String variableName) Future<DataFrame?>
Read a variable as DataFrame (if compatible)
readVariable(String path, String variableName) Future
Read a specific MATLAB variable