主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

Python 包集成

将编译的 MATLAB® 函数集成到 Python® 应用程序中

MATLAB Compiler SDK™ 提供了 Python 方法,用于初始化 MATLAB Runtime,调用编译的 MATLAB 函数,以及管理在 Python 代码和 MATLAB Runtime 之间传递的数据。

有关兼容的 Python 版本的列表,请参阅 MATLAB 支持的其他语言接口

除非以进程外模式调用,否则您无法打包从 MATLAB 调用 Python 的 MATLAB 代码。

App

Python 包编译器MATLAB 程序打包为 Python 包以供部署。 (自 R2025a 起)

函数

全部展开

compiler.build.pythonPackageMATLAB 外部的部署创建 Python (自 R2021a 起)
compiler.build.PythonPackageOptions构建 Python 包的选项 (自 R2021a 起)
compiler.build.Results编译器编译结果对象
compiler.package.installerMATLAB Compiler 生成的文件创建安装程序
compiler.package.InstallerOptions创建 MATLAB Compiler 包安装程序的选项
myDeployedModule.initializePython 模块初始化包并返回句柄
myDeployedModule.initialize_runtime使用启动选项列表初始化 Python Runtime 的 MATLAB 模块
myDeployedModule.wait_for_figures_to_closePython 模块等待所有图形关闭后再继续
myDeployedModule.terminatePython 模块关闭包
mwpythonMATLAB macOS 上使用 Compiler SDK Python 包启动 Python 会话

主题

要求和重点

创建并与 Python 集成

示例应用

数据转换