Python 与 Matlab混合语言编程资料

1.论文 Python 与 Matlab混合语言编程 作者 董焰民,王保保

2.需要下载相应版本的pywin32

资料下载

https://files.cnblogs.com/finallyliuyu/pythonmatlabmixcoding.rar

2.python调用M文件

mport os

datafile=file(r'f.dat')

s=datafile.read()

import dictformation

mydict=dictformation.myDictionary(s)

f=mydict.keys()

#x=array(f)

g=mydict.values()

#y=array(g)

filename='fin'

f.m','w')

fid.write("""

f=%s;

g=%s;

plot(x,y)

z=x+y;

pause(10)

hold on

""" %(f,g))

fid.write("exit")

fid.close()

cmd="E:\\\\matlab\\\\bin\\\\win32\\\\matlab.exe -r"+filename

os.system(cmd)

print 'finish'

matplotlib的使用文档英文http://matplotlib.sourceforge.net/