Import CompiledPythonPackages
TheMATLAB®Compiler SDK™Python®target generates the Python code into a package that must be imported into Python before you can use the compiled MATLAB functions. You specify the package name and the namespace when compiling the MATLAB functions.
If you use the Library Compiler app, you specify the package name with theLibrary Namefield and the namespace with theNamespacefield.
TheLibrary Namefield defaults to the name of the first MATLAB file listed in the app. You can leave theNamespacefield empty.
If you use the
mcc
function, you specify the package name and namespace as part of the-W python:
flag.namespace
.packageName
Specifying the namespace is optional.
For example, if you compile your MATLAB functions and specify the package name asaddmatrix
with no namespace, you import it as follows:
import addmatrix
If you compile your MATLAB functions using themcc
command with the option-W python:com.mathworks.addmatrix
, you import it as follows:
import com.mathworks.addmatrix