What are the Python types accepted by MATLAB?
Show older comments
I tried the following, using both MATLAB R2017b and R2017a from Python 2.7 IDLE:
>>> import numpy as np
>>> image = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 2.0]], dtype="uint8")
>>> image
array([[1, 0, 0],
[0, 1, 2]], dtype=uint8)
>>> g = eng.mean(image)
However, I received the following error:
Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
g = eng.mean(image)
File "C:\Python27\lib\site-packages\matlab\engine\matlabengine.py", line 73, in __call__
out=_stdout, err=_stderr)
TypeError: unsupported Python data type: numpy.ndarray
Does it mean that non built-in Python types (such as NumPy) are not supported by MATLAB?
Accepted Answer
More Answers (0)
Categories
Find more on Call Python from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!