How does Python package generated in Matlab allow for "import matlab"?
8 views (last 30 days)
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:
a = matlab.double([[1,2,3], [4,5,6]])
blah = PythonSimple.initialize()
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.