mat2np : turn MATLAB array into a Python Numpy object
Version 1.0.0.0 (2.2 KB) by
CY Y
Saves a 1-D or 2-D MATLAB array into pickled Numpy array
Saves 1-D or 2-D MATLAB array into a pickled Numpy array. (Currently only tested in Python 3). Supported datatypes : 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'float64'.
Example usage :
in MATLAB :
a = [ 1.2, 3.5, 4.3 ];
mat2np(a, 'a.pkl', 'float64')
then in Python :
import pickle
with open('a.pkl', 'rb') as fin :
a = pickle.load(fin)
Cite As
CY Y (2026). mat2np : turn MATLAB array into a Python Numpy object (https://github.com/joe-of-all-trades/mat2np), GitHub. Retrieved .
MATLAB Release Compatibility
Created with
R2016a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Call Python from MATLAB in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Versions that use the GitHub default branch cannot be downloaded
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | added support for unsigned integer |
|
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.
