使用matpy从MATLAB调用Python函数

时间:2015-02-19 11:56:25

标签: python matlab interface mex

我刚刚为matpy(http://algoholic.eu/matpy/)设置了系统,但它似乎仍无效...

设定: - Windows 7 64位 - MATLAB R2014a 64位 - WinPython 2.7.9.2 64位

在MATLAB中我输入了:

>> mex py.cpp '-IC:\Program Files\WinPython-64bit-2.7.9.2\python-2.7.9.amd64\include' '-LC:\Program Files\WinPython-64bit-2.7.9.2\python-2.7.9.amd64\libs'
Building with 'Microsoft Visual C++ 2013 Professional'.
MEX completed successfully.

现在,如果我输入

>> py_shell
py> print "Hello, World!"
py>
没有任何反应。如何检查我的系统是否正常运行?可能是什么原因不起作用?

1 个答案:

答案 0 :(得分:0)

Winpython必须在您的PATH变量中才能正常运行。 也许你应该:

  • 在调用Matlab之前调用C:\ Program Files \ WinPython-64bit-2.7.9.2 \ python-2.7.9.amd64 \ scripts \ env.bat?

  • 修改您的默认系统以包含它。

希望它有所帮助或将为您提供线索

这家伙说它也在使用python(x,y) http://algoholic.eu/matpy/

==>你确定它适用于64位吗?