How does Python package generated in Matlab allow for "import matlab"?
2 ビュー (過去 30 日間)
古いコメントを表示
I am developing a Python package from my Matlab functions using Matlab Compiler SDK within R2018a. I used this tutorial. I got the basic functionality down and executed the functions in Python, but I am now working on input/outputs data types. Some of the help files reference the Matlab array classes via 'import matlab' in python. For example, a Python code might look like:
import PythonSimple
import matlab
a = matlab.double([[1,2,3], [4,5,6]])
blah = PythonSimple.initialize()
print(blah.python_trial(a))
blah.terminate()
where PythonSimple is Python package I compiled from Matlab code. My question, when is the python package 'matlab' installed for python. ie. Why is it that the 'import matlab' works on my machine even though I never had to do a 'pip install matlab' or equivalent? Do I need Matlab on my machine to call 'import matlab' or does the matlab package get installed for Python when I install my compiled packages Python simple (python PythonSimple.py install)? I need to know because the systems on which I eventually will deploy PythonSimple will not have Matlab installed, but it would be helpful if I could use the matlab package Python data types within my Python scripts to simplify the input/output data type conversions.
Thanks.
2 件のコメント
Janak Thotakura
2018 年 8 月 10 日
The workflow mentioned in the below link should have installed all the required files.
https://www.mathworks.com/help/compiler_sdk/python/install-a-matlab-compiler-sdk-python-package.html
Can you confirm if you have used python setup.py install? Or are you following a different workflow?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Python Package Integration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!