' MatlabWorkSpace'对象不可调用

时间:2017-05-22 21:02:25

标签: python matlab machine-learning matlab-deployment

eng = matlab.engine.start_matlab()
for line in matcode:
    eng.workspace(line, nargout=0)

res = eng.workspace['x']
eng.quit()

和matcode.txt对象字符串是

'x = [1 1;1 2;1 3;1 4];'

无法弄清楚为什么会发生这种情况:(

Traceback (most recent call last):
File "lreg.py", line 14, in <module>
  main()
File "lreg.py", line 10, in main
  data = matlab_engine.start_engine(code_object)
File "/Users/hiteshkr/PycharmProjects/MLCO/matlab_engine.py", line 7,  in start_engine
  eng.workspace(line, nargout=0)
TypeError: 'MatlabWorkSpace' object is not callable

0 个答案:

没有答案