使用pymatbridge连接matlab和python



当我试图使用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']

Thanks in advance.

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

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

最新更新