Wednesday, February 4, 2009

Visual C++中调用MATLAB引擎配置

Visual C++中调用MATLAB引擎配置

Visual C++环境中调用MATLAB引擎,首先需要对Visual C++环境进行配置,按照以下步骤进行MATLAB引擎环境配置。

1) 运行Mircosoft Visual C++在菜单栏【File】下选择新建一个工程文件,选择【New】,点击【Project】属性页,选择【Win32 Console Application】,给出工程文件名称。

2) 选择菜单栏【Tools】下的【Options】,在【Directories】属性页下,设置相关的Include文件路径,Libray文件路径和Executable文件路径。Inlcude文件路径设置为%matlabroot%\extern\include,其中%matlabroot%为读者计算机中MATLAB应用程序的安装根目录,Library文件路径设置为%matlabroot%\extern\lib\win32\microsoft, Executable文件路径设置为%matlabroot%\bin\win。

3)选择菜单栏【Project】下的【Setting】选项,在【Link】属性页中,添加libeng.lib,libmex.lib,libmx.lib,libmat.lib库文件,注意库文件之间使用空格而不使用逗号,否则编译会出错。

More details could be found in my published book:
MATLAB编程基础与典型应用
北京:人民邮电出版社,2008
ISBN:978-7-115-17932-6/TP

Pls contact me with Email:lhd06@mails.tsinghua.edu.cn

No comments: