How does Python package generated in Matlab allow for "import matlab"?
조회 수: 1 (최근 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!