1、步骤如下:(1)在Command window中输入mbuild -setup显示如下:>> mbuild -setupPlease choose your compiler forbuilding standalone MATLAB applications:Would you like mbuild to locate installed compilers[y]/n? n %选择n具体见下图。然后按照图2所示操作。
2、在matlab的Command window中输入:>>deploytoolMatlab产生deployment tool配置窗口(如下图):
3、单击新建按钮,新建工程------>选择MATLAB Builder NE 选项卡----->选择.NET Component并添加工程砘捃坑聒名eaqual(测试用名,其实工程名称就是你导入C#后的命名空间名称,Matlab会在当前工作目录中新建文件夹文件夹名既为equal)---->点击ADD File按钮将你需要编译的MATLAB函数添加进当前工程,我这里导入的是 D:\Program Files\MATLAB\R2008b\toolbox\aero\aero\angle2quat.m文件---->点击build.(见下图)deployment tool output 窗口输出以下信息:Build output( 2009-03-28 15:32:55).mcc -F'E:\MATLAB\eaqual.prj'等待...................................有点久当输出以下信息时编译成功了Compiler version: 4.9 (R2008b) Warning:Duplicate directory name: E:\MATLAB. mcc -W 'dotnet:eaqual,Eaqual,0.0,private'-d 'E:\MATLAB\eaqual\src' -T 'link:lib' -v 'class{Eaqual:D:\ProgramFiles\MATLAB\R2008b\toolbox\aero\aero\angle2quat.m}' Warning:…………You can package the component by clickingon the "Package" icon in the Deployment Tool toolbar, or by clickingthe Tools->Package menu when the Deployment Tool panel is selected. Toinclude additional files in the package, click Project->Settings).生成的文件在工程文件夹里面我的是 E:\MATLAB\eaqual\distrib\angle2quat.dll至此MATLAB的操作全部完成