主要内容

La traducción de esta página está obsoleta。Haga clic aquí para ver la última versión en inglés。

电话一个PythondesdeMATLAB

我直接和Python一起玩®desde MATLAB®

Puede acceder a las bibliotecas de Python directamente desde MATLAB agregando el prefijopy。al nombre Python。Consulte从MATLAB开始访问Python模块.比如:

py。list({'This','is a','list'}) %调用内置函数列表py.textwrap。wrap('This is a string') %在模块textwrap中调用wrap函数
Puede ejutar instrucciones de Python en el intérprete de Python directamente desde MATLAB usando las funcionespyrunopyrunfile.比如:
pyrun("l = ['A', 'new', 'list']") % Python解释器中的调用列表
Para obtener más información, consulte从MATLAB直接调用Python功能

用MATLAB计算函数用Python计算,参考Llamar的MATLAB desde PythonPara obtener más información。

一些必要

expandir待办事项

pyenv 更改默认环境Python翻译
PythonEnvironment Python环境信息
pyrun 运行Python的声明MATLAB
pyrunfile 运行Python脚本文件MATLAB
pyargs 创建关键字参数Python函数
matlab.exception.PyException 捕获错误信息Python异常

特马

Usar bibliotecas de Python en MATLAB

Ejecutar código de Python desde MATLAB

Paso de datos

Solución de problemas

判断错误是Python错误还是MATLAB错误

提示确定错误是否源于Python或MATLAB代码。

Python支持的限制万博1manbetx

Python特性在MATLAB中不支持。万博1manbetx

处理Python异常

MATLAB捕获Python抛出的异常,并将它们转换为matlab.exception.PyException对象。

排除矩阵和数字参数错误

错误可能由具有多个非单维的输入数组引起。