Using Matlab compiler to compile a matlab script with some python module imported

4 ビュー (過去 30 日間)
uathena
uathena 2017 年 7 月 25 日
回答済み: Matthew Parrilla 2018 年 7 月 19 日
I am trying to compile a matlab script using Matlab Application compiler. However, in the matlab script, I use a python object adb_object from adb_lib.py (written by myself). I call the python object in the following way:
tmp = py.adb_lib.adb_object()
I've already tried to add the adb_lib.py as well as 'C:\Python27\python.exe' with mcc -a, but when I run the compiled exe file, it's still said:
Undefined Variable "py" or class "py.adb_lib.adb_object".
Any idea about this? Thanks!

回答 (2 件)

uathena
uathena 2017 年 7 月 25 日
It turns out you need to put the module file in the same folder as the compiled files by hand. Using mcc -a won't add the file...
  1 件のコメント
Matthew Parrilla
Matthew Parrilla 2018 年 7 月 16 日
Were you able to find out anything better than adding the files by hand?

サインインしてコメントする。


Matthew Parrilla
Matthew Parrilla 2018 年 7 月 19 日
Add the file to "Files installed for your end user" and it will work.
As of this writing this isn't very well documented, unfortunately.

カテゴリ

Help Center および File ExchangePython Package Integration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by