我想打开并保存一个文件。在#import and start the engine
import matlab.engine
eng = matlab.engine.start_matlab()
print('Matlab engine started')
#File of interest
myBadFile='test.mat'
#Synchronize python/matlab working directory
eng.cd(os.getcwd(),nargout=0)
print(eng.pwd())
#Read file contents
VALUES=eng.load(myBadFile,nargout=1)
到目前为止还不错。我真的很惊讶它能如此顺利地工作。在
我在VALUES上完成了我的工作,然后我想再次保存它。
如果我这么做VALUES=eng.save(myBadFile+'.test','VALUES','-v6',nargout=0)
我得到:
^{pr2}$
如果是的话VALUES=eng.save(myBadFile+'.test',VALUES,'-v6',nargout=0)
我明白了MatlabExecutionError: Argument must contain a character vector.
那么如何保存我的值呢?在python环境中,它是一个有效的变量,但是在matlab中却看不到它呢?在