Handle Data Returned from MATLAB to Python
MATLAB Scalar Type to Python Type Mapping
When MATLAB® functions return output arguments, MATLAB Engine API for Python® converts the data into equivalent Python data types.
MATLAB Output Argument Type
— | Resulting Python Data Type |
---|---|
|
|
|
|
Complex (any numeric type) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Structure |
|
MATLAB handle object (such as the
|
MATLAB returns a reference to a
|
MATLAB value object (such as the
| Opaque object. You can pass a value object to a MATLAB function but you cannot create or modify it. |
MATLAB Array Type to Python Type Mapping
MATLAB Output Argument Type
— | Resulting Python Data Type |
---|---|
Numeric array |
|
|
|
|
|
Row or column cell array |
|
Unsupported MATLAB Types
MATLAB Engine API for Python does not support these MATLAB data types.
char
array (M
-by-N
)Cell array (
M
-by-N
)Sparse array
Structure array
Non-MATLAB objects (such as Java® objects)