Deploying MATLAB engine API for Python

7 ビュー (過去 30 日間)
Joaquin Ambia
Joaquin Ambia 2024 年 9 月 4 日
コメント済み: Raghava S N 2024 年 10 月 21 日
I develop a softare in MATLAB, and some users are interested in runing some parts of it throug Python. The end user does not have Matlab. Is it possible to deploy it, as we do with the MRC for them?

回答 (1 件)

Raghava S N
Raghava S N 2024 年 9 月 5 日
この 回答 は Joaquin Ambia さんによってフラグが設定されました
Hi,
To package a MATLAB function and deploy it as a Python application, follow the workflow described in the following link - https://www.mathworks.com/help/compiler_sdk/gs/create-a-python-application-with-matlab-code.html. The link describes the workflow in depth and consists of the following steps -
  1. Write the function code in MATLAB.
  2. Create a Python package using the function compiler.build.pythonPackage
  3. The function can take name-value arguments as well for more detailed specifications. For more information, refer to the following link - https://www.mathworks.com/help/compiler_sdk/python/compiler.build.pythonpackage.html
  4. The function generates several files and stores them in the current working directory. For more details, refer to the following link - https://www.mathworks.com/help/compiler_sdk/gs/create-a-python-application-with-matlab-code.html#:~:text=3.%20The%20function%20generates%20the%20following%20files%20within
  5. After creating the Python package, it can be called from a Python application. The following link describes how to install and run a MATLAB generated Python application - https://www.mathworks.com/help/compiler_sdk/gs/create-a-python-application-with-matlab-code.html.
Hope it helps!
  2 件のコメント
Joaquin Ambia
Joaquin Ambia 2024 年 9 月 5 日
It does not help. It does not answer the question at all. This answer looks AI generated.
Raghava S N
Raghava S N 2024 年 10 月 21 日
Hi,
The Python version the end-user will be using should be supported by the MATLAB Compiler SDK. You can verify this with the help of this link - https://www.mathworks.com/support/requirements/language-interfaces.html.
Also, refer to this link to check if the MATLAB Compiler SDK Python Target Requirements are met - https://www.mathworks.com/help/compiler_sdk/python/matlab-compiler-sdk-python-target-requirements.html.
Most importantly, MATLAB Runtime is version-specific. You must run your applications with the version of MATLAB Runtime associated with the version of MATLAB Compiler with which it was created. For example, if you compiled an application using release R2023a of MATLAB, end users must install version R2023a at the same update level or later of MATLAB Runtime. Use "mcrversion" to return the version number of MATLAB Runtime - https://www.mathworks.com/help/compiler_sdk/ml_code/mcrversion.html.
Also, any details about the MATLAB program being deployed to Python would also help in diagnosing the issue better.
Hope to hear from you.

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

カテゴリ

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

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by