使用pymatbridge连接matlab和python

时间:2013-06-07 04:34:47

标签: python matlab

当我尝试使用pymatbridge连接python和matlab时,我收到以下错误..

MATLAB started and connected!
Traceback (most recent call last):
  File "pscript.py", line 4, in <module>
    res = mlab.run('/home/GuestAccounts/Intern002/FingerPrint/fingerprintnew.m')
AttributeError: 'Matlab' object has no attribute 'run'

我该如何纠正这个?我使用以下脚本进行连接

from pymatbridge import Matlab
mlab = Matlab(matlab='/pkgs/matlab/R2009a/bin/matlab')
mlab.start()
res = mlab.run('/home/GuestAccounts/Intern002/FingerPrint/fingerprintnew.m')
print res['result']

提前致谢..

1 个答案:

答案 0 :(得分:1)

根据docs,看起来你应该使用:

res = mlab.run_func('../file.m')