Matlab与C++接口与混合编程讨论小结


本文结合SMTH上的Mathtools版大家的讨论和自己的一些使用心得,主要对 

MIDEVA(Matcom)的使用方法作简单介绍。本文将版面上一些相关文章作了总结 
并将精华区中dodoo所写的“用c编写mex程序”一文以及energy所写的“VC++中 
使用MATLAB的C++数学库和MCC生成的程序”作为本文的第二章。希望大家能对这 
个主题有一个全面的了解,同时也能进行进一步的讨论和更广泛的交流。 

目 录 

第一章、概述 

第二章、在Matlab中使用mex和mcc(作者dodoo,energy) 
2.1 用c编写mex程序[1]--dodoo 
2.2 用c编写mex程序[2]--dodoo 
2.3 用c编写mex程序[3]--dodoo 
2.4 用c编写mex程序[4]--dodoo 
2.5 用c编写mex程序[5]--dodoo 
2.6 用c编写mex程序[6]--dodoo 
2.7 VC++中使用MATLAB的C++数学库和MCC生成的程序--energy 

第三章、Matcom的使用 
3.1 概述 
3.1.1 Matcom能作什么 
3.1.2 Matcom的工作原理 
3.1.3 Matcom的不足 
3.1.4 Matcom下载地址及网络资源 
3.2 版本及安装注意事项 
3.2.1 MIDEVA 4.0 的安装 
3.2.2 MIDEVA 4.5 的安装 
3.3 用Matcom翻译m文件 
3.4 如何得到CPP源文件 
3.5 在CB中C++与Matlab语言混编 
3.6 程序的发布 

附录一、Matcom的函数分类列表 
-- 

第一章、概述 

Matlab是当今世界上使用最为广泛的数学软件,它具有相当强大的数值计算、 
数据处理、系统分析、图形显示,甚至符号运算功能,是一个完整的数学平 
台,在这个平台上,你只需寥寥数语就可以完成十分复杂的功能,大大提高了 
工程分析计算的效率。另外由于Matlab的广泛使用,于是出现了为各个领域专 
门使用的工具箱(即在某一研究领域常用数学工具的函数包),这些工具箱的出现 
更加促进了Matlab的流行。 

Matlab强大的功能只能在它所提供的平台上才能使用,也就是说,你必需在 
安装有matlab系统的机器上使用.m文件,这样就给工程计算带来了很大不便;特 
别是,在matlab中,使用的行解释方式执行代码,这样大大地限制了代码执行速度。 
于是人们想到,能否开发一个matlab与其他高级语言的接口,这样就可以把matlab 
的强大功能融入各种应用程序中,并且通过高级语言编译器编译为2进制代码, 
从而大大提高了执行速度。 

于是matlab的5.1版本提供了自带的C++ Complier,同时MathTools公司也为 
Matlab开发了m文件高效解释和调试IDE:MIDEVA。经过近两年的发展,matlab 5.3 
中的C complier--mcc版本已经为2.0,而MIDEVA最新版本为4.5。 
将matlab与C混合编程大概有如下三种方法: 

1.用Matlab的mcc将.m文件翻译为cpp源文件,然后在C编译器中调用 
也可以用mcc编译编译为stand-alone程序。 

2.用Matcom(MIDEVA)将.m文件翻译为cpp代码,并编译为exe或dll 
文件。 

3.按照matcom的语法,在VC或BCB中直接书写matlab语句(与matlab 
很相似),这也是我最喜欢用的方法。 

方法1和2/3各有利弊,1不支持图形(支持图形的库国内现在还没有D), 
1对类支持也不够,2支持绝大多数的matlab语句(包括图形),但对 
于struct等的支持也有缺陷。 



-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:03 

二章、 
第一节、用c编写mex程序[开篇] 

用C编写mex程序 
大家都知道,matlab是一种解释型的编程环境,也就是说,跟以前的basic一样,是读 
一句执行一句的。这样做可以很方便的实现编程过程中的交互,也免去了麻烦又耗时的 
编译过程。但凡事有一利必有一弊,matlab在执行时速度慢也就根源于此。在matlab里 
tic 
for i=1:10000 
b(i)=a(10001-i); 
end 
怎么样,是不是很慢? 
你的程序里如果再多几个这样的循环,运行速度就可想而知了。 
上面程序的功能是将向量a里的数据逆序赋给向量b。下面的程序可以实现相同的功能 
tic 
b=a(10000:-1:1); 
为什么这个程序运行速度就这么快呢?这是因为matlab里的基础矩阵运算函数,像转 
置,复制等等,都是以二进制程序的形式存在的,运行起来速度当然比解释执行10000次 
所以编matlab程序时,应该尽量避免用循环语句,而使用等效的矩阵运算。虽然这样 
但总是有的时候没法找到对应的矩阵运算来等效,或编出来的程序复杂得让人没法修 
简单地说,mex程序就是根据一定的接口规范(mtlab提出的)编写的一个dll,matla 
比如我编了一个mex函数,名字叫max2.dll,那么只要把这个dll所在的目录加到matlab 
的搜索路径里(用addpath),就可以像调用普通matlab函数一样来调用它了。因为把 

循环体放到了二进制程序中,执行速度快得多。 

Mex文件既可以用c,也可以用fortran来编。因为我用的是c语言,所以下面的介绍都 
是用c语言编写mex文件的方法。如果你用的是fortran,请你自己去看Apiguide.pdf,里 
面有详细说明。   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:03 

第二章、 
第二节、用c编写mex程序[一] 

前面说到通过把耗时长的函数用c语言实现,并编译成mex函数可以加快执行速度。这 
Matlab5.1本身是不带c语言的编译器的,所以要求你的机器上已经安装有VC,BC或Wat 
com C中的一种。如果你在安装Matlab时已经设置过编译器,那么现在你应该就可以使用 
mex命令来编译c语言的程序了。如果当时没有选,只要在Matlab里键入 mex -setup 
,就会出现一个DOS方式窗口,下面只要根据提示一步步设置就可以了。由于我用的是w 
听说Matlab5.2已经内置了C语言的编译器,那么下面的这些可能就用不着了。可惜现 
需要注意的是,在设置编译器路径时,只能使用路径名称的8字符形式。比如我用的V 
C5装在路径 C:\PROGRAM FILES\DEVSTUDIO下,那在设置路径时就要写成:C:\PROGRA~1 
这样设置完之后,mex就可以执行了。为了测试你的路径设置正确与否,把下面的程序 
存为hello.c。 

#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 

mexPrintf("hello,world!\n"); 


假设你把hello.c放在了C:\TEST\下,在Matlab里用CD C:\TEST\ 将当前目录改为C:\ 
TEST\(注意,仅将C:\TEST\加入搜索路径是没有用的)。现在敲: 
mex hello.c 
如果一切顺利,编译应该在出现编译器提示信息后正常退出。如果你已将C:\TEST\加 
入了搜索路径,现在键入hello,程序会在屏幕上打出一行: 
hello,world! 
看看C\TEST\目录下,你会发现多了一个文件:HELLO.DLL。 
这样,第一个mex函数就算完成了。怎么样,很简单吧。下一次,会对这个最简单的程 
序进行分析,并给它增加一些功能。   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:04 

第二章、 
第三节、用c编写mex程序[三] 

分析hello.c,可以看到程序的结构是十分简单的,整个程序由一个接口子过程 
mexFunction构成。前面提到过,Matlab的mex函数有一定的接口规范,就是指这 
nlhs:输出参数数目 
plhs:指向输出参数的指针 
nrhs:输入参数数目 
例如,使用 [a,b]=test(c,d,e) 调用mex函数test时,传给test的这四个参数分别是2, 
plhs,3,prhs。其中: 
prhs[0]=c 
prhs[1]=d 
prhs[2]=e 

当函数返回时,将会把你放在plhs[0],plhs[1]里的地址赋给a和b,达到返回数据的目 
的。 

细心的你也许已经注意到,prhs和plhs都是指向类型mxArray类型数据的指针。 
这个类型是在mex.h中定义的,事实上,在Matlab里大多数数据都是以这种类型存在。当 
然还有其他的数据类型,可以参考Apiguide.pdf里的介绍。 
为了让大家能更直观地了解参数传递的过程,我们把hello.c改写一下,使它能根据输 
入参数的变化给出不同的屏幕输出: 

//hello.c 2.0 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 

int i; 
i=mxGetScalar(prhs[0]); 
if(i==1) 
mexPrintf("hello,world!\n"); 
else 
mexPrintf("大家好!\n"); 


将这个程序编译通过后,执行hello(1),屏幕上会打出: 
hello,world! 

而hello(0)将会得到: 

大家好! 

现在,程序hello已经可以根据输入参数来给出相应的屏幕输出。在这个程序里,除了用 
到了屏幕输出函数mexPrintf(用法跟c里的printf函数几乎完全一样)外,还用到了一 
个函数:mxGetScalar,调用方式如下: 

i=mxGetScalar(prhs[0]); 

"Scalar"就是标量的意思。在Matlab里数据都是以数组的形式存在的,mxGetScalar的 
作用就是把通过prhs[0]传递进来的mxArray类型的指针指向的数据(标量)赋给C程序里 
的变量。这个变量本来应该是double类型的,通过强制类型转换赋给了整形变量i。 

既然有标量,显然还应该有矢量,否则矩阵就没法传了。看下面的程序: 

//hello.c 2.1 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], 
int nrhs, const mxArray *prhs[]) 

int *i; 
i=mxGetPr(prhs[0]); 
if(i[0]==1) 
mexPrintf("hello,world!\n"); 
else 
mexPrintf("大家好!\n"); 


这样,就通过mxGetPr函数从指向mxArray类型数据的prhs[0]获得了指向double类型的 

指针。 
但是,还有个问题,如果输入的不是单个的数据,而是向量或矩阵,那该怎么处理呢 
?通过mxGetPr只能得到指向这个矩阵的指针,如果我们不知道这个矩阵的确切大小,就 
没法对它进行计算。 
为了解决这个问题,Matlab提供了两个函数mxGetM和mxGetN来获得传进来参数的行数 
和列数。下面例程的功能很简单,就是获得输入的矩阵,把它在屏幕上显示出来: 

//show.c 1.0 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 


double *data; 
int M,N; 
int i,j; 

data=mxGetPr(prhs[0]); //获得指向矩阵的指针 
M=mxGetM(prhs[0]); //获得矩阵的行数 
N=mxGetN(prhs[0]); //获得矩阵的列数 
for(i=0;i 


for(j=0;j 
mexPrintf("%4.3f ",data[j*M+i]); 

mexPrintf("\n"); 





编译完成后,用下面的命令测试一下: 

a=1:10; 
b=[a;a+1]; 
show(a) 
show(b) 

需要注意的是,在Matlab里,矩阵第一行是从1开始的,而在C语言中,第一行的序数 
为零,Matlab里的矩阵元素b(i,j)在传递到C中的一维数组大data后对应于data[j*M+i] 。   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:04 

第二章、 
第四节、用c编写mex程序[四] 
输入数据是在函数调用之前已经在Matlab里申请了内存的,由于mex函数与Matlab共用同 
一个地址空间,因而在prhs[]里传递指针就可以达到参数传递的目的。但是,输出参数 
却需要在mex函数内申请到内存空间,才能将指针放在plhs[]中传递出去。由于返回指针 
类型必须是mxArray,所以Matlab专门提供了一个函数:mxCreateDoubleMatrix来实现内 
存的申请,函数原型如下: 
mxArray *mxCreateDoubleMatrix(int m, int n, mxComplexity ComplexFlag) 
m:待申请矩阵的行数 
n:待申请矩阵的列数 
为矩阵申请内存后,得到的是mxArray类型的指针,就可以放在plhs[]里传递回去了。但 
是对这个新矩阵的处理,却要在函数内完成,这时就需要用到前面介绍的mxGetPr。使用 
mxGetPr获得指向这个矩阵中数据区的指针(double类型)后,就可以对这个矩阵进行各 
种操作和运算了。下面的程序是在上面的show.c的基础上稍作改变得到的,功能是将输 

//reverse.c 1.0 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], 
int nrhs, const mxArray *prhs[]) 

double *inData; 
double *outData; 
int M,N; 
int i,j; 

inData=mxGetPr(prhs[0]); 
M=mxGetM(prhs[0]); 
N=mxGetN(prhs[0]); 

plhs[0]=mxCreateDoubleMatrix(M,N,mxREAL); 
outData=mxGetPr(plhs[0]); 
for(i=0;i for(j=0;j outData[j*M+i]=inData[(N-1-j)*M+i]; 


当然,Matlab里使用到的并不是只有double类型这一种矩阵,还有字符串类型、稀疏矩 
阵、结构类型矩阵等等,并提供了相应的处理函数。本文用到编制mex程序中最经常遇到 
的一些函数,其余的详细情况清参考Apiref.pdf。   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:05 

第二章、 
第五节、用c编写mex程序[五] 
通过前面两部分的介绍,大家对参数的输入和输出方法应该有了基本的了解。具备了这 
些知识,就能够满足一般的编程需要了。但这些程序还有些小的缺陷,以前面介绍的re 
由于前面的例程中没有对输入、输出参数的数目及类型进行检查,导致程序的容错性很 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], 
int nrhs, const mxArray *prhs[]) 

double *inData; 
double *outData; 
int M,N; 
//异常处理 
if(nrhs!=1) 

mexErrMsgTxt("USAGE: b=reverse(a)\n"); 

if(!mxIsDouble(prhs[0])) 

mexErrMsgTxt("the Input Matrix must be double!\n"); 

inData=mxGetPr(prhs[0]); 

M=mxGetM(prhs[0]); 

N=mxGetN(prhs[0]); 

plhs[0]=mxCreateDoubleMatrix(M,N,mxREAL); 

outData=mxGetPr(plhs[0]); 

for(i=0;i 
for(j=0;j 
outData[j*M+i]=inData[(N-1-j)*M+i]; 



在上面的异常处理中,使用了两个新的函数:mexErrMsgTxt和mxIsDouble。MexErrMsgT 

xt在给出出错提示的同时退出当前程序的运行。MxIsDouble则用于判断mxArray中的数据 

是否double类型。当然Matlab还提供了许多用于判断其他数据类型的函数,这里不加详 

述。 

需要说明的是,Matlab提供的API中,函数前缀有mex-和mx-两种。带mx-前缀的大多是对 

mxArray数据进行操作的函数,如mxIsDouble,mxCreateDoubleMatrix等等。而带mx前缀 

的则大多是与Matlab环境进行交互的函数,如mexPrintf,mxErrMsgTxt等等。了解了这 

一点,对在Apiref.pdf中查找所需的函数很有帮助。 

至此为止,使用C编写mex函数的基本过程已经介绍完了。下面会在介绍几个非常有用的 

函数调用。如果有足够的时间,也许还会有一个更复杂一些的例程。 


-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:05 

第二章、 
第六节、用c编写mex程序[六] 
我们之所以使用Matlab,很重要的考虑是Matlab提供了相当丰富的矩阵运算函数和各 
种toolbox。在编制mex函数时,有时我们也会遇到一些操作,在Matlab下,只需要一个 
为了在mex函数里调用Matlab命令,我们就需要用到一个函数mexCallMATLAB,原型如下: 
int mexCallMATLAB(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[], 
const char *command_name); 
有了前面的基础,使用这个函数就显得十分容易了。下面给出一个例程,功能是将输入 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], 
int nrhs, const mxArray *prhs[]) 


double *inData; 

mxArray *IN[1]; 

mxArray *OUT[1]; 

double *outData; 

int M,N; 

int i,j; 

//异常处理 

if(nrhs!=1) 

mexErrMsgTxt("USAGE: b=rot(a)\n"); 

if(!mxIsDouble(prhs[0])) 

mexErrMsgTxt("the Input Matrix must be double!\n"); 

//计算转置 

if(mexCallMATLAB(1,OUT,1,prhs,"'")) 

mexErrMsgTxt("Error when compute!\n"); 

//根据输入参数数目决定是否显示 

if(nlhs==0) 

mexCallMATLAB(0,IN,1,OUT,"disp"); 

else 

plhs[0]=OUT[0]; 



关于这个例子,相信大家一看就明白,我就不多说了。   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:05 

第三章、Matcom的使用 

3.1 概述 

3.1.1 Matcom能作什么 

Matcom是一个十分有用的.m文件翻译器(Replacement),它的主要优点我认为有 
以下几点: 

1>它提供了matlab中.m文件与其他高级语言的接口,使.m文件可以编译为脱离 
matlab环境独立执行的可执行性程序,这样 
。提高了代码的复用率 
。提高了代码的执行速度 
。使纯文本的.m文件变为二进制的可执行程序,增加了知识保护的安全性 
2>它提供了近千个数学函数,对于其他高级语言编译器来说,提供了一个丰富 
的数学库,基本上在matlab上能用的常用函数都可以在高级语言中直接调用。 
数学函数主要包括: 
。矩阵属性函数 
。矩阵生成函数 
。矩阵操作函数 
。矩阵变换函数 
。数学函数 
。特殊函数 
。数值函数 
。串函数 
。绘图函数 
。颜色函数 
。函数函数 
。存盘及读文件 
。系统资源函数 
。系统操作函数 
。判断函数(Is函数族) 
。付氏变换 
等等,可参见本文附录 
3>提供了.m文件的方便快捷的编译调适环境,可以step, watch,breakpoint等各种 
调试手段。 

3.1.2 Matcom的工作原理 

Matcom的矩阵运算部分是基于一个名为Matrix的C++数学库,这个库提供了 
绝大多数的关于矩阵类、矩阵操作函数、数值计算函数、数学函数等的定义,在 
Matcom中是以lib目录下的*.lib以及windows/system/对应名称的dll文件提供的。 
Matcom的另一大部分就是图形部分,它是用一种非常流行的绘图OCX控件Teechart来 
实现的,这种控件对于一般的绘图功能都可以实现,但也存在一定缺陷。在 
Matcom4.5版本中使用的是TeeChart3.0。绘图函数功能主要在lib文件和 
window/system/ago*.dll中定义的。 
Matcom编译.m文件是先将.m文件按照与matcom的Cpp库的对应关系,翻译为CPP源代码, 
然后用对应版本的C编译器将该CPP文件编译为exe或dll文件,所以,在第一次运行时 
让指定C Complier的路径是必需的,否则将无法编译。指定好的C Complier的信息写在 
Matcom/bin/matcom.ini文件中。 

3.1.3 Matcom的不足 

Matcom并不是全能的,对于大多数Matlab函数都可以进行CPP实现,但有些由于其功能 
有限,只能期待以后的版本来不断补充了。 
总的来说,matcom有以下缺欠: 

1.对class数据类型部分支持 
2.eval,feval,clear等语句不能在C中实现(如果实现的话,一个文本编辑器就可以成为 
一个matlab了:)) 
3.图形窗口有些不仅如人意,如fill3,hide等语句无法实现,surf等语句也无法画出象 
matlab中哪样精细的图像来,特别是色彩比较难看:( 
等等 

3.1.4 Matcom下载地址及网络资源 

下载地址是版上询问最多的问题,再次建议大家能到教育网的搜索引擎 
http://pccms.pku.edu.cn:8000/ 
http://search.igd.edu.cn 
http://soft.cs.uestc.edu.cn/search.php 

搜索关键字matcom或MIDEVA,可以查找教育网上的最新的matcom资源 
Matcom的开发者Mathtools公司地址是 
http://www.mathtools.com/上面也提供了免费下载服务他们还会给你一个 
evaluation key),如果你从哪里下载,他们会给你定期发email告诉最新 
的动态。 
大家可以定期到公司主页看看有没有版本更新   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:06 

3.2 版本及安装注意事项 

3.2.1 Matcom 4.0 的安装 

由于matcom4.0所代的dll文件相对较小,所以便于发布小型程序,所以这里也对它作一 
定讨论。 
matcom4.0在第一次使用时需要你输入口令,否则无法运行,不过网上已经有matcom4 
的注册机,可以查找一个叫regmat4.exe的小程序,输入你想使用的时间区间,然后 
就会产生一个合法口令,输入这个口令后,mideva在window目录建立一个名字叫mt_eva 
l.txt的 
文本文件,里面就保存了你输入的口令,不过你也可以在执行matcom之前直接建立这个 
文件, 
在里面写1/1/1999-1/1/2010-64562264就可使用到2010年。 

通过了口令后,它还有一些限制,如绘图时间不超过60分钟限制,绘图时出现版权对话 
框 
等,不过这些已经被energy等诸位大虾给破解了具体如下 

energy: 
使用PLOT功能时会出现一个对话框,可以这样去掉: 
C:\Windows\system\ago.dll 
FIND: 83 C4 08 85 C0 75 05 
REP : -- -- -- -- -- EB -- 
如果还想去掉figure标题栏上的[Evaluation software]: 
FIND: 43 61 70 74 75 72 65 00 20 5B 
REP : -- -- -- -- -- -- -- -- -- 00 
huangfh (hoho)对60分钟时间的破解, 就比较完整了: 
FIND : 2B D1 81 FA 10 0E 00 00 7E 10 
REP : -- -- -- -- -- -- -- -- EB -- 

3.2.2 Matcom 4.5 的安装 

感谢energy的破解,Matcom4.5的口令为FREE-4.5-1193046-80295111 
matcom4.5在安装时需要你输入口令,mideva在window的注册表中 
HKEY_CURRENT_USER\Software\MathTools\Matcom.50\License\ 
下面添加一个键,键名默认,键值为FREE-4.5-1193046-80295111 
你如果删除它,再次启动matcom的时候,就会再次询问口令。 
不过好在如果通过这个口令之后,程序发布时就不再有限制了,也 
就是在这个注册后的系统中编译的程序,发布时就不用代一个注册文件了   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:06 

3.3 用Matcom翻译m文件 

直接调适M文件:在主界面上打开.m文件的主文件,在菜单中选择compile to exe 
or dll 就可以了,你也可以设置断点后,就可以查看变量的值,这些将在主窗口 
的一侧出现,双击就可得到其当前值。 
编译后的cpp、exe、dll文件都在matcom 当前工作目录下,如果是debug模式,就在 
dubug目录下找,否则就在Release目录下找。 

3.4 在CB中C++与Matlab语言混编 

这种方法是我最喜欢的方法,因为这样不但可以发挥matcom强大的数学计算功能, 
还可以结合可视化编译环境来进行界面开发,可以制作完整的应用计算软件, 
交付用户使用。 
我所用的可视IDE是Inprise公司的C++Builder 3.0/4.0,matcom版本为4.0/4.5, 
注意,在CB4.0上只能使用matcom4.5版本。 
在进行编程之前你需要作如下准备工作 

1.选择菜单New\Console Wizard\Console Exe,建立一个Win32位DOS程序 
2.将matcom\lib\matlib.h拷贝到CB\include目录下 
将matcom\lib\v4500b.lib拷贝到CB\lib目录下 
3.选择菜单Project\Add to project\选择lib\v4500.lib 

于是程序变为 
#pragma hdrstop 
#include 
#include "stdio.h" 
#include "matlib.h" 
//--------------------------------------------------------------------------- 
USELIB("v4500b.lib"); 
//--------------------------------------------------------------------------- 
#pragma argsused 
int main(int argc, char **argv) 

/*****************************************/ 
// Please Write Your Code Here */ 
/*****************************************/ 
return 0; 


3.选择菜单Project\Add to Reportaries\ 将该工程存为Project中的一个模板。 
OK,现在可以进行你所需要的工作了。 
用菜单你存为的模板建立一个新的工程,在代码段写 

dMm(a); //define a Matrix class 
a=zeros(3); //Let the matrix be a 3*3 zero matrix 
disp(a); //Display the matrix 

运行一下看看,程序会打印出3*3的0零阵 
稍微复杂一点的程序 

dMm(a);dMm(b);dMm(c); //声明三个矩阵 
a=rand(3,2); //生成3*2随机阵 
b=zeros(3,2); 
c=a+b; //矩阵相加 
c(1,c_p)=a(2,c_p); //matlab中写为c(1,:)=a(2,:) 
c=ctranspose(c); //矩阵转置 
disp(c);printf("\n"); 
disp(a);printf("\n"); 
getch(); 
c(colon(1,1,3))=a(colon(1,2,5)); //matlab中写为c([1:1:3])=a([1:2:5]) 
disp(c); 
getch(); 

可以发现在matlab中常用的一些表示都可以在matcom中找到对应,并且同样 
方便有效。 
再举一个绘图的例子,就用matcom自己带的例子吧 

subplot(121.0); //subplot(1,2,1) 
surf((CL(peaks(25.0)))); //surf(peaks(25)) 
subplot(122.0); //subplot(1,2,2) 
pcolor((CL(peaks(25.0)))); //pcolor(peaks(25)) 
colormap(TM("copper")); //colormap('copper') 
drawnow() //必须有这句,否则只画一个图出来 
//这是我问他们的技术支持搞到的 

可以看到基本上是一句对一句,没有什么多余的话。所以习惯编写 
matlab程序的同志写matcom C的语句来也应该没有什么问题。 
(但上面这个程序确实有问题,在mideva中编译后第二个subplot 
是可以正常画出来的,但在CB中编译就只画一个subplot乐,具体 
原因希望大家讨论,我现在也在试),mideva编译该语句的指令是 

bcc32 文件名 -IC:\MATCOM45\lib -H=matlib.csm -v -a4 -5 -e 
EXEFLAGS= -WC 
DLLFLAGS= -WD 

我想CB中可能要改option,大家试试看。 
总的说来,决大多数的matlab的语句都可以轻松移植到CB中来,所以就可以直接在 
CB中写matlab程序了,只是大家要注意几个关键的函数 

colon(xstart,xstep,xstop) == xstart:xstep:xstop 
(CL(A1),A2,A3....) == (A1,A2,A3,...)一个矩阵行,大多数 
多参数输入函数都用到CL 
(BR(a1),a2,a3....) == (a1,a2,a3...) 
TM("a string") == 'a string' TM将char *变为串矩阵 
c_p == : 整行或整列 
i_o == [out]=fun(in)就写为fun(in, i_o, out) 
其他的大家编几个程序就清楚了。   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结(一) Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 10:07 

3.6 程序的发布 

matcom可以用C编译器把.m文件编译为为stand_alone的程序,所以,基本上 
不需要matlab系统,但一些必要的dll文件还是需要的,这些dll在window\system\ 
下面,(在4.5版本中)大概有ago4500.dll,v4500v.dll,opengl32.dll, glu32.dll等 
四个文件 

如果用的是4.0版本,发布时要把ago.dll,mlib4...dll(计不清楚了),opengl32.dll和 
glu32.dll打到安装盘中,大概3M,然后在window目录安装一个名字叫mt_eval.txt的 
文本文件,里面写1/1/1999-1/1/2010-64562264即可 

附录:Matcom C数学库函数列表(部分) 
这是一个丰富的数学库,约600个函数,包括sim()函数 
-------------------------------------------------------------------------- 
矩阵基础类 
系统常数 
特殊函数 
异常处理函数 
矩阵生成函数 
操作系统资源函数 
数值计算函数 
数学函数 
矩阵操作函数 
矩阵属性函数 
图形函数 
颜色函数 
用户介面函数 
is*函数族 
mex函数 
字符串函数 
类型转换函数 
************************************************************************** 
>>> 矩阵基础类 
************************************************************************** 
class Mm 

DLLI Mm(); 
DLLI Mm(int isc, int iss, int nonzeros, int nrows, int ncols, mt_matrix_ty 
pes new_type=mt_double_matrix); 
DLLI Mm(int isc, int iss, int nonzeros, int new_ndims, const int new_dims[ 
max_ndims], mt_matrix_types new_type=mt_double_matrix); 
DLLI Mm(i_o_t, const char* mname, int isglobal); 
DLLI Mm(const char* mname, int m, int n); 
DLLI Mm(int aisc, cMm x, cMm y, cMm dim1, op_t op, int do_dim, Mm& minmax_ 
idx); 
DLLI Mm(m_type src); 
DLLI Mm(cMm src); 
DLLI Mm(cMm src, const char* mname); 
DLLI Mm(const Mc[$ src)] 
DLLI Mm(cMr src, int err=1); 
DLLI ~Mm(); 
Mm RDLLI operator =(cMm src); 
void DLLI deepcopy(cMm src, mt_matrix_types new_type=mt_uninit_matrix); 
void DLLI deepcopy(int isc, cMm src, mt_matrix_types new_type=mt_uninit_ma 
trix); 
void DLLI deepcopy(int isc, int iss, cMm src, mt_matrix_types new_type=mt_ 
uninit_matrix); 
int DLLI getreal(int force=0) const; 
int DLLI getcomplex(); 
void DLLI collapse(); 
inline int DLLI rows() const { return dims[0]; } 
inline int DLLI cols() const { return dims[1]; } 
int DLLI size() const; 
int DLLI size(int dim) const; 
int DLLI nsingleton() const; 
int DLLI vectordim() const; 
int DLLI length() const; 
const char PDLLI getname() const { return self_name; } 
void DLLI setname(const char* new_name); 
int DLLI isstr() const { return (flags.str!=0); } 
void DLLI setstr(int newd); 
inline int DLLI issparse() const { return (flags.sparse!=0); } 
void DLLI setsparse(int sp); 
inline int DLLI islogical() const { return (flags.logical!=0); } 
void DLLI setlogical(int newd); 
inline int DLLI isglobal() const { return (flags.global!=0); } 
inline int DLLI isstruct() const { return (fields!=NULL); } 
inline int RDLLI getndims() const { return (int[$)ndims] } 
inline int PDLLI getdims() const { return (int*)dims; } 
inline M_types RDLLI getflags() { return flags; } 
inline mt_matrix_types DLLI gettype() const { return flags.type; } 
inline int DLLI getnfields() const { return nfields; } 
inline const char PPDLLI getfields() const { return fields; } 
inline int DLLI isc() const { return (pi!=NULL); } 
int DLLI issamename(const char *s) const { return s==self_name; } 
int DLLI dirty() const; 
int DLLI getp() const { return p; } 
Mm DLLI safebr(int i0) const; 
inline m_type PDLLI getpr(m_type*) const { return (m_type*)pr; } 
inline m_type PDLLI getpi(m_type*) const { return (m_type*)pi; } 
inline uint8 PDLLI getpr(uint8*) const { return (uint8*)pr; } 
inline uint8 PDLLI getpi(uint8*) const { return (uint8*)pi; } 
inline Mm PDLLI getpr(Mm*) const { return (Mm*)pr; } 
inline Mm PDLLI getpi(Mm*) const { return (Mm*)pi; } 
inline m_type PDLLI getpr(m_type*,int i0) const { return i0-1+(m_type*)pr; 

inline m_type PDLLI getpi(m_type*,int i0) const { return i0-1+(m_type*)pi; 

inline uint8 PDLLI getpr(uint8*,int i0) const { return i0-1+(uint8*)pr; 

inline uint8 PDLLI getpi(uint8*,int i0) const { return i0-1+(uint8*)pi; 

inline Mm PDLLI getpr(Mm*,int i0) const { return i0-1+(Mm*)pr; } 
inline Mm PDLLI getpi(Mm*,int i0) const { return i0-1+(Mm*)pi; } 
inline m_type PDLLI getpr(m_type*,int i0,int i1) const { return i0-1+(i1-1 
)*dims[0]+(m_type*)pr; } 
inline m_type PDLLI getpi(m_type*,int i0,int i1) const { return i0-1+(i1-1 
)*dims[0]+(m_type*)pi; } 
inline uint8 PDLLI getpr(uint8*,int i0,int i1) const { return i0-1+(i1-1 
)*dims[0]+(uint8*)pr; } 
inline uint8 PDLLI getpi(uint8*,int i0,int i1) const { return i0-1+(i1-1 
)*dims[0]+(uint8*)pi; } 
inline Mm PDLLI getpr(Mm*,int i0,int i1) const { return i0-1+(i1-1 
)*dims[0]+(Mm*)pr; } 
inline Mm PDLLI getpi(Mm*,int i0,int i1) const { return i0-1+(i1-1 
)*dims[0]+(Mm*)pi; } 
m_type PDLLI addr() const; 
m_type PDLLI addr(int i0) const; 
m_type PDLLI addr(int i0,int i1) const; 
m_type PDLLI addi() const; 
m_type PDLLI addi(int i0) const; 
m_type PDLLI addi(int i0,int i1) const; 
inline int PDLLI getindex() const { return index; } 
inline int RDLLI getnnz() const { return (int[$)nnz] } 
m_type RDLLI r() const; 
m_type RDLLI r(double i0) const; 
m_type RDLLI r(double i0, double i1) const; 
m_type RDLLI r(double i0, double i1, double i2) const; 
m_type RDLLI i() const; 
m_type RDLLI i(double i0) const; 
m_type RDLLI i(double i0, double i1) const; 
m_type RDLLI i(double i0, double i1, double i2) const; 
uint8 RDLLI ur(int i0) const; 
uint8 RDLLI ur(int i0, int i1) const; 
Mm RDLLI mr(int i0) const; 
Mm RDLLI mr(int i0, int i1) const; 
Mr DLLI member(const char* field) const { return Mr(*this, field); } 
Mr DLLI operator ()(cMm i0) const { return Mr(Mr_idx_paren, *this, i0); } 
Mr DLLI operator ()(cMm i0, cMm i1) const { return Mr(Mr_idx_paren, *this, 
i0, i1); } 
Mr DLLI operator ()(cMm i0, cMm i1, cMm i2) const { return Mr(Mr_idx_paren 
, *this, i0, i1, i2); } 
Mr DLLI operator ()(cMm i0, cMm i1, cMm i2, cMm i3) const { return Mr(Mr_i 
dx_paren, *this, i0, i1, i2, i3); } 
Mr DLLI br(cMm i0) const { return Mr(Mr_idx_br,*this, i0); } 
Mr DLLI br(cMm i0, cMm i1) const { return Mr(Mr_idx_br,*this, i0, i1); } 
Mr DLLI br(cMm i0, cMm i1, cMm i2) const { return Mr(Mr_idx_br,*this, i0, 
i1, i2); } 
Mr DLLI br(cMm i0, cMm i1, cMm i2, cMm i3) const { return Mr(Mr_idx_br,*th 
is, i0, i1, i2, i3); } 
m_type[$ fastindex(double i0) const { return pr[int(i0)-1]] } 
m_type& fastindex(double i0, double i1) const { return pr[int(i0)-1+(int(i 
1)-1)*dims[0]]; } 
void DLLI vwcopy1(cMm src, cMm v); 
void DLLI vwcopy2(cMm src, cMm v, cMm w); 
void DLLI vwcopyn(cMr src, cMm rhs); 
void DLLI vwcopy0(cMr src); 
int DLLI findfield(const char* field, int err) const; 
const char PDLLI getfield(int i) const; 
int DLLI addfield(const char* field,int quick); 
int DLLI rmfield(const char* field); 
void DLLI extend_nfields(int new_nfields); 
int DLLI getclassid() const { return classid; } 
void DLLI setclassid(int new_classid) { classid=new_classid; } 
void DLLI reshape(const int m, const int n); 
void DLLI reshape(const int new_ndims, const int new_dims[max_ndims]); 
void DLLI print(int full) const; 
void DLLI warn_uninit() const; 
void DLLI resparse(); 
int DLLI search(int idx) const; 
void DLLI sort(); 
void DLLI extend_nnz(int new_nnz); 
}; // M 
Mc DLLI BR(cMm src); 
Mc DLLI CL(cMm src); 
m_type DLLI scalar(m_type x); 
m_type DLLI scalar(cMm x); 
Mm DLLI switchinit(cMm x); 
**************************************************************************** 
***** 
>>> 系统常数 
************************************************************************** 
extern DLLW double DLLI nargin_val; 
extern DLLW double DLLI nargout_val; 
extern DLLW int DLLI nargin_set; 
extern DLLW int DLLI nargout_set; 
extern DLLW Mm DLLI TICTOC; 
extern DLLW Mm DLLI ans; 
extern DLLW Mm DLLI i; 
extern DLLW Mm DLLI j; 
extern DLLW Mm DLLI pi; 
extern DLLW Mm DLLI Inf; 
extern DLLW Mm DLLI NaN; 
extern DLLW Mm DLLI eps; 
extern DLLW Mm DLLI x_M; 
extern DLLW Mm DLLI semi; 
extern DLLW Mm DLLI c_p; 
extern DLLW Mm DLLI nop_M; 
extern DLLW Mm DLLI zero_M; 
extern DLLW Mm DLLI one_M; 
extern DLLW Mm DLLI l_M; 
extern DLLW Mm DLLI page_screen_output; 
extern DLLW Mm DLLI implicit_str_to_num_ok; 
extern DLLW Mm DLLI empty_list_elements_ok; 
extern DLLW Mm DLLI switchvar; 
**************************************************************************** 

>>> 特殊函数 
************************************************************************** 
Mm DLLI airy(cMm z); 
Mm DLLI airy(cMm k, cMm z); 
Mm DLLI airy(cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI airy(cMm k, cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI bessel(cMm nu); 
Mm DLLI bessel(cMm nu, cMm z); 
Mm DLLI bessel(cMm nu, cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI bessela(cMm nu); 
Mm DLLI bessela(cMm nu, cMm z); 
Mm DLLI bessela(cMm nu, cMm z, i_o_t, Mm[$ J, Mm& ndigits)] 
Mm DLLI besselh(cMm nu); 
Mm DLLI besselh(cMm nu, cMm z); 
Mm DLLI besselh(cMm nu, cMm k, cMm z); 
Mm DLLI besselh(cMm nu, cMm k, cMm z, cMm scale1); 
Mm DLLI besselh(cMm nu, cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI besselh(cMm nu, cMm k, cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI besselh(cMm nu, cMm k, cMm z, cMm scale1, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI besseli(cMm nu); 
Mm DLLI besseli(cMm nu, cMm z); 
Mm DLLI besseli(cMm nu, cMm z, cMm scale1); 
Mm DLLI besseli(cMm nu, cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI besseli(cMm nu, cMm z, cMm scale1, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI besselj(cMm nu); 
Mm DLLI besselj(cMm nu, cMm z); 
Mm DLLI besselj(cMm nu, cMm z, cMm scale1); 
Mm DLLI besselj(cMm nu, cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI besselj(cMm nu, cMm z, cMm scale1, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI besselk(cMm nu); 
Mm DLLI besselk(cMm nu, cMm z); 
Mm DLLI besselk(cMm nu, cMm z, cMm scale1); 
Mm DLLI besselk(cMm nu, cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI besselk(cMm nu, cMm z, cMm scale1, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI bessely(cMm nu); 
Mm DLLI bessely(cMm nu, cMm z); 
Mm DLLI bessely(cMm nu, cMm z, cMm scale1); 
Mm DLLI bessely(cMm nu, cMm z, i_o_t, Mm[$ w, Mm& err)] 
Mm DLLI bessely(cMm nu, cMm z, cMm scale1, i_o_t, Mm[$ w, Mm& err)] 
**************************************************************************** 

>>> 特殊数据类型定义 
************************************************************************** 
Mm DLLI cell(cMm x); 
Mm DLLI cell(cMm x, cMm y); 
Mm DLLI cell(cMm x, cMm y, cMm o); 
Mm DLLI cell(cMm x, cMm y, cMm o, cMm p); 
Mm DLLI cells(cMm x); 
Mm DLLI cells(cMm x, cMm y); 
Mm DLLI cellstr(cMm x); 
Mm DLLI cell_from_array(int n, const Mm* x[]); 
Mm DLLI cell2struct(cMm x); 
Mm DLLI cell2struct(cMm x, cMm f); 
Mm DLLI cell2struct(cMm x, cMm f, cMm dim1); 
int DLLI iscellstr(cMm x); 
int DLLI isa(cMm x); 
int DLLI isa(cMm x, cMm cls); 
Mm DLLI mclass(cMm x); 
Mm DLLI mclass(cMm x, cMm class_name); 
Mm DLLI mchar(cMm varargin); 
Mm DLLI mdouble(cMm x); 
Mm DLLI mlogical(cMm x); 
Mm DLLI muint8(cMm x); 
Mm DLLI muint16(cMm x); 
Mm DLLI fieldnames(cMm s); 
Mm DLLI isfield(cMm s); 
Mm DLLI isfield(cMm s, cMm f); 
Mm DLLI getfield(cMm s); 
Mm DLLI getfield(cMm s, cMm varargin); 
Mm DLLI mstruct(cMm varargin); 
Mm DLLI setfield(cMm s); 
Mm DLLI setfield(cMm s, cMm field); 
Mm DLLI setfield(cMm s, cMm field, cMm v); 
Mm DLLI struct2cell(cMm s); 
Mm DLLI rmfield(cMm s); 
Mm DLLI rmfield(cMm s, cMm fields); 
**************************************************************************** 
******** 
>>> 异常处理函数 
**************************************************************************** 
******* 
*************************************************************************** 
******** 
>>> 矩阵生成函数 
**************************************************************************** 
******* 
Mm DLLI cauchy(Mm x); 
Mm DLLX cauchy(Mm x, Mm y); 
Mm DLLI compan(cMm x); 
Mm DLLI gallery(Mm n); 
Mm DLLI hadamard(Mm n); 
Mm DLLI hankel(Mm c); 
Mm DLLI hankel(Mm c, Mm r); 
Mm DLLI hilb(Mm n); 
Mm DLLI invhilb(Mm n); 
Mm DLLI magic(Mm n); 
Mm DLLI pascalM(cMm n); 
Mm DLLI pascalM(Mm n, Mm r); 
Mm DLLI rosser(); 
Mm DLLI toeplitz(Mm c); 
Mm DLLI toeplitz(Mm c, Mm r); 
Mm DLLI vander(Mm x); 
Mm DLLI wilkinson(cMm n); 
**************************************************************************** 

>>> 操作系统资源函数 
**************************************************************************** 
******* 
Mm DLLI cd(); 
Mm DLLI cd(cMm dir1); 
Mm DLLI chdir(cMm dir1); 
Mm DLLI copyfile(cMm src); 
Mm DLLI copyfile(cMm src, cMm dest); 
Mm DLLI deleteM(cMm filename); 
Mm DLLI dos(cMm command); 
Mm DLLI dos(cMm command, i_o_t, Mm[$ status, Mm& sout)] 
Mm DLLI dos(cMm command, cMm echo); 
Mm DLLI dos(cMm command, cMm echo, i_o_t, Mm[$ status, Mm& sout)] 
Mm DLLI fclose(cMm fid); 
Mm DLLI feof(cMm fid); 
Mm DLLI ferror(cMm fid); 
Mm DLLI ferror(cMm fid, cMm clear); 
Mm DLLI ferror(cMm fid, cMm clear, i_o_t, Mm[$ msg, Mm& errnum)] 
Mm DLLI ferror(cMm fid, i_o_t, Mm[$ msg, Mm& errnum)] 
Mm DLLI fflush(cMm fid); 
Mm DLLI fgetl(cMm fid); 
Mm DLLI fgets(cMm fid); 
Mm DLLI fgets(cMm fid, cMm nchar); 
Mm DLLI filesep(); 
Mm DLLI fopen(cMm filename); 
Mm DLLI fopen(cMm filename, cMm permission); 
Mm DLLI fopen(cMm filename, cMm permission, cMm machine); 
Mm DLLI fopen(cMm filename, cMm permission, cMm machine, i_o_t, Mm& fid, Mm& 
msg); 
Mm DLLI fopen(cMm filename, cMm permission, i_o_t, Mm[$ fid, Mm& msg)] 
Mm DLLI fopen(cMm filename, i_o_t, Mm[$ fid, Mm& msg)] 
Mm DLLI fopen(cMm fid, i_o_t, Mm[$ filename, Mm& permission, Mm& machine)] 
Mm DLLI fprintf(cMm fid, cMm format1); 
Mm DLLI fprintf(cMm fid, cMm format1, cMm varargin); 
Mm DLLI fprintf(cMm x); 
Mm DLLI fread(cMm fid); 
Mm DLLI fread(cMm fid, cMm size); 
Mm DLLI fread(cMm fid, cMm size, cMm precision); 
Mm DLLI fread(cMm fid, cMm size, cMm precision, cMm skip); 
Mm DLLI fread(cMm fid, cMm size, cMm precision, cMm skip, cMm machine); 
Mm DLLI fread(cMm fid, cMm size, cMm precision, cMm skip, cMm machine, i_o_t 
, Mm[$ A, Mm& count)] 
Mm DLLI fread(cMm fid, cMm size, cMm precision, cMm skip, i_o_t, Mm& A, Mm& 
count); 
Mm DLLI fread(cMm fid, cMm size, cMm precision, i_o_t, Mm[$ A, Mm& count)] 
Mm DLLI fread(cMm fid, cMm size, i_o_t, Mm[$ A, Mm& count)] 
Mm DLLI fread(cMm fid, i_o_t, Mm[$ A, Mm& count)] 
Mm DLLI frewind(cMm fid); 
Mm DLLI fscanf(cMm fid); 
Mm DLLI fscanf(cMm fid, cMm format1); 
Mm DLLI fscanf(cMm fid, cMm format1, cMm size); 
Mm DLLI fscanf(cMm fid, cMm format1, cMm size, i_o_t, Mm[$ A, Mm& count)] 
Mm DLLI fscanf(cMm fid, cMm format1, cMm size, i_o_t, Mm& A, Mm& count, Mm& 
errmsg); 
Mm DLLI fscanf(cMm fid, cMm format1, i_o_t, Mm[$ A, Mm& count)] 
Mm DLLI fseek(cMm fid); 
Mm DLLI fseek(cMm fid, cMm offset); 
Mm DLLI fseek(cMm fid, cMm offset, cMm origin); 
Mm DLLI ftell(cMm fid); 
Mm DLLI fullfile(cMm varargin); 
Mm DLLI fwrite(cMm fid); 
Mm DLLI fwrite(cMm fid, cMm A); 
Mm DLLI fwrite(cMm fid, cMm A, cMm precision); 
Mm DLLI fwrite(cMm fid, cMm A, cMm precision, cMm skip); 
Mm DLLI fwrite(cMm fid, Mm A, cMm precision, cMm skip, cMm machine); 
Mm DLLI help(cMm keyword); 
Mm DLLI mkdir(cMm dir1); 
Mm DLLI pathsep(); 
Mm DLLI printf(cMm format1); 
Mm DLLI printf(cMm format1, cMm varargin); 
Mm DLLI rmdir(cMm dir1); 
Mm DLLI stderrM(); 
Mm DLLI stdinM(); 
Mm DLLI stdoutM(); 
Mm DLLI system(cMm cmd); 
Mm DLLI type(cMm fname); 
Mm DLLI unixM(cMm command); 
Mm DLLI unixM(cMm command, i_o_t, Mm[$ status, Mm& sout)] 
**************************************************************************** 
*** 
>>> 数值计算函数 
**************************************************************************** 
******* 
Mm DLLI fft(cMm x); 
Mm DLLI fft(cMm x, cMm n); 
Mm DLLI fft(cMm x, cMm n, cMm dim1); 
Mm DLLI ifft(cMm x); 
Mm DLLI ifft(cMm x, cMm n); 
Mm DLLI ifft(cMm x, cMm n, cMm dim1); 
Mm DLLI dft(cMm x); 
Mm DLLI fft2(cMm x); 
Mm DLLI fft2(cMm x, cMm m); 
Mm DLLI fft2(cMm x, cMm m, cMm n); 
Mm DLLI ifft2(cMm x); 
Mm DLLI ifft2(cMm x, cMm m); 
Mm DLLI ifft2(cMm x, cMm m, cMm n); 
Mm DLLI fftshift(cMm x); 
Mm DLLI ifftshift(cMm x); 
int DLLI automesh(cMm x); 
int DLLI automesh(cMm x, cMm y); 
int DLLI automesh(cMm x, cMm y, cMm z); 
Mm DLLI dsearch(cMm x, cMm y, cMm tri, cMm xi, cMm yi); 
Mm DLLI delaunay(cMm x); 
Mm DLLI delaunay(cMm x, cMm y); 
Mm DLLI delaunay(cMm x, cMm y, cMm sorted); 
Mm DLLI griddata(cMm x, cMm y, cMm z, cMm xi, cMm yi); 
Mm DLLI griddata(cMm x, cMm y, cMm z, cMm xi, cMm yi, cMm method); 
Mm DLLI griddata(cMm x, cMm y, cMm z, cMm xi, cMm yi, i_o_t, Mm& XI, Mm& YI, 
Mm[$ ZI)] 
Mm DLLI griddata(Mm x, Mm y, Mm z, Mm xi, Mm yi, cMm method, i_o_t, Mm& XI, 
Mm[$ YI, Mm& ZI)] 
Mm DLLI interp1(cMm y); 
Mm DLLI interp1(cMm y, cMm xi); 
Mm DLLI interp1(Mm x, Mm y, Mm xi); 
Mm DLLI interp1(Mm x, Mm y, Mm xi, cMm method); 
Mm DLLI interp1q(cMm x, cMm y, cMm xi); 
Mm DLLI interp2(cMm z); 
Mm DLLI interp2(cMm z, Mm D); 
Mm DLLI interp2(cMm z, Mm xi, Mm yi); 
Mm DLLI interp2(cMm z, cMm xi, cMm yi, cMm method); 
Mm DLLI interp2(cMm x, cMm y, cMm z, cMm xi, cMm yi); 
Mm DLLI interp2(Mm x, Mm y, Mm z, Mm xi, Mm yi, cMm method); 
Mm DLLI interp3(cMm v); 
Mm DLLI interp3(cMm v, cMm D); 
Mm DLLI interp3(cMm v, cMm D, cMm method); 
Mm DLLI interp3(cMm v, cMm xi, cMm yi, cMm zi); 
Mm DLLI interp3(cMm v, cMm xi, cMm yi, cMm zi, cMm method); 
Mm DLLI interp3(cMm v, cMm xi, cMm yi, cMm zi, cMm method, cMm dummy); 
Mm DLLI interp3(cMm x, cMm y, cMm z, cMm v, cMm xi, cMm yi, cMm zi); 
Mm DLLI interp3(Mm x, Mm y, Mm z, Mm v, Mm xi, Mm yi, Mm zi, cMm method); 
Mm DLLI tsearch(cMm x, cMm y, cMm tri, cMm xi, cMm yi); 
Mm DLLI mkpp(Mm b); 
Mm DLLI mkpp(Mm b, Mm c); 
Mm DLLI poly(cMm x); 
Mm DLLI polyder(cMm x); 
Mm DLLI polyder(cMm x, cMm y); 
Mm DLLI polyder(cMm x, i_o_t, Mm[$ a, Mm& b)] 
Mm DLLI polyder(cMm x, cMm y, i_o_t, Mm[$ a, Mm& b)] 
Mm DLLI polyfit(cMm x); 
Mm DLLI polyfit(cMm x, cMm y); 
Mm DLLI polyfit(cMm x, cMm y, cMm n); 
Mm DLLI polyfit(Mm x, Mm y, cMm n, i_o_t, Mm[$ p, Mm& s)] 
Mm DLLI polyval(Mm p); 
Mm DLLI polyval(Mm p, Mm x); 
Mm DLLI polyvalm(cMm p); 
Mm DLLI polyvalm(cMm p, cMm x); 
Mm DLLI ppval(Mm p); 
Mm DLLI ppval(cMm p, Mm x); 
Mm DLLI roots(Mm p); 
Mm DLLI spline(Mm x); 
Mm DLLI spline(cMm x, cMm y); 
Mm DLLI spline(cMm x, cMm y, cMm x2); 
Mm DLLI ss2tf(cMm a, cMm b, cMm c, cMm d, i_o_t, Mm[$ num, Mm& den)] 
Mm DLLI ss2tf(cMm a, Mm b, cMm c, Mm d, cMm iu, i_o_t, Mm[$ num, Mm& den)] 
Mm DLLI ss2zp(cMm a, cMm b, cMm c, cMm d, i_o_t, Mm[$ z, Mm& p, Mm& k)] 
Mm DLLI ss2zp(cMm a, cMm b, cMm c, cMm d, i_o_t, Mm[$ z, Mm& p)] 
Mm DLLI ss2zp(cMm a, cMm b, cMm c, cMm d, cMm iu, i_o_t, Mm& z, Mm& p, Mm& k 
); 
Mm DLLI tf2ss(Mm num, Mm den, i_o_t, Mm[$ a, Mm& b, Mm& c, Mm& d)] 
Mm DLLI tf2zp(cMm num, cMm den, i_o_t, Mm[$ z, Mm& p)] 
Mm DLLI tf2zp(Mm num, Mm den, i_o_t, Mm[$ z, Mm& p, Mm& k)] 
Mm DLLI unmkpp(cMm pp, i_o_t, Mm[$ b, Mm& c, Mm& l, Mm& k)] 
Mm DLLI zp2tf(cMm z, cMm p, Mm k, i_o_t, Mm[$ num, Mm& den)] 
Mm DLLI zp2ss(Mm z, Mm p, cMm k, i_o_t, Mm[$ a, Mm& b, Mm& c, Mm& d)] 
Mm DLLI constr(cMm func); 
Mm DLLI constr(cMm func, cMm x0); 
Mm DLLI constr(cMm func, cMm x0, cMm options); 
Mm DLLI constr(cMm func, cMm x0, cMm options, cMm vlb); 
Mm DLLI constr(cMm func, cMm x0, cMm options, cMm vlb, cMm vub); 
Mm DLLI constr(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, cMm grad); 
Mm DLLI constr(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, cMm grad, cM 
m varargin); 
Mm DLLI constr(cMm func, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI constr(cMm func, cMm x0, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI constr(cMm func, cMm x0, cMm options, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI constr(cMm func, cMm x0, cMm options, cMm vlb, i_o_t, Mm& x, Mm& opt 
ions_o); 
Mm DLLI constr(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, i_o_t, Mm& x 
, Mm[$ options_o)] 
Mm DLLI constr(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, cMm grad, i_ 
o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI constr(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, cMm grad, cM 
m varargin, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI curvefit(cMm func); 
Mm DLLI curvefit(cMm func, cMm x0); 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata); 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, cMm ydata); 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, cMm ydata, cMm options); 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, cMm ydata, cMm options, cMm gr 
ad); 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, cMm ydata, cMm options, cMm gr 
ad, cMm varargin); 
Mm DLLI curvefit(cMm func, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI curvefit(cMm func, cMm x0, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, cMm ydata, i_o_t, Mm& x, Mm& o 
ptions_o); 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, cMm ydata, cMm options, i_o_t, 
Mm[$ x, Mm& options_o)] 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, cMm ydata, cMm options, cMm gr 
ad, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI curvefit(cMm func, cMm x0, cMm xdata, cMm ydata, cMm options, cMm gr 
ad, cMm varargin, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI fmin(cMm func); 
Mm DLLI fmin(cMm func, cMm a); 
Mm DLLI fmin(cMm func, cMm a, cMm b); 
Mm DLLI fmin(cMm func, cMm a, cMm b, cMm options); 
Mm DLLI fmin(cMm func, cMm a, cMm b, cMm options, cMm varargin); 
Mm DLLI fmin(cMm func, i_o_t, Mm[$ xo, Mm& options_o)] 
Mm DLLI fmin(cMm func, cMm a, i_o_t, Mm[$ xo, Mm& options_o)] 
Mm DLLI fmin(cMm func, cMm a, cMm b, i_o_t, Mm[$ xo, Mm& options_o)] 
Mm DLLI fmin(cMm func, cMm a, cMm b, cMm options, i_o_t, Mm& xo, Mm& options 
_o); 
Mm DLLI fmin(cMm func, cMm a, cMm b, cMm options, cMm varargin, i_o_t, Mm& x 
o, Mm[$ options_o)] 
Mm DLLI fmins(cMm func); 
Mm DLLI fmins(cMm func, cMm x); 
Mm DLLI fmins(cMm func, cMm x, cMm options); 
Mm DLLI fmins(cMm func, cMm x, cMm options, cMm grad); 
Mm DLLI fmins(cMm func, cMm x, cMm options, cMm grad, cMm varargin); 
Mm DLLI fmins(cMm func, i_o_t, Mm[$ x_o, Mm& options_o)] 
Mm DLLI fmins(cMm func, cMm x, i_o_t, Mm[$ x_o, Mm& options_o)] 
Mm DLLI fmins(cMm func, cMm x, cMm options, i_o_t, Mm[$ x_o, Mm& options_o)] 
Mm DLLI fmins(cMm func, cMm x, cMm options, cMm grad, i_o_t, Mm& x_o, Mm& op 
tions_o); 
Mm DLLI fmins(cMm func, cMm x, cMm options, cMm grad, cMm varargin, i_o_t, M 
m[$ x_o, Mm& options_o)] 
Mm DLLI fminu(cMm func); 
Mm DLLI fminu(cMm func, cMm x); 
Mm DLLI fminu(cMm func, cMm x, cMm options); 
Mm DLLI fminu(cMm func, cMm x, cMm options, cMm grad); 
Mm DLLI fminu(cMm func, cMm x, cMm options, cMm grad, cMm varargin); 
Mm DLLI fminu(cMm func, i_o_t, Mm[$ x_o, Mm& options_o)] 
Mm DLLI fminu(cMm func, cMm x, i_o_t, Mm[$ x_o, Mm& options_o)] 
Mm DLLI fminu(cMm func, cMm x, cMm options, i_o_t, Mm[$ x_o, Mm& options_o)] 
Mm DLLI fminu(cMm func, cMm x, cMm options, cMm grad, i_o_t, Mm& x_o, Mm& op 
tions_o); 
Mm DLLI fminu(cMm func, cMm x, cMm options, cMm grad, cMm varargin, i_o_t, M 
m[$ x_o, Mm& options_o)] 
Mm DLLI foptions(); 
Mm DLLI foptions(Mm options); 
Mm DLLI fsolve(cMm func); 
Mm DLLI fsolve(cMm func, cMm x); 
Mm DLLI fsolve(cMm func, cMm x, cMm options); 
Mm DLLI fsolve(cMm func, cMm x, cMm options, cMm grad); 
Mm DLLI fsolve(cMm func, cMm x, cMm options, cMm grad, cMm varargin); 
Mm DLLI fsolve(cMm func, i_o_t, Mm[$ x_o, Mm& options_o)] 
Mm DLLI fsolve(cMm func, cMm x, i_o_t, Mm[$ x_o, Mm& options_o)] 
Mm DLLI fsolve(cMm func, cMm x, cMm options, i_o_t, Mm[$ x_o, Mm& options_o)] 

Mm DLLI fsolve(cMm func, cMm x, cMm options, cMm grad, i_o_t, Mm& x_o, Mm& o 
ptions_o); 
Mm DLLI fsolve(cMm func, cMm x, cMm options, cMm grad, cMm varargin, i_o_t, 
Mm[$ x_o, Mm& options_o)] 
Mm DLLI fzero(cMm func); 
Mm DLLI fzero(cMm func, cMm x); 
Mm DLLI fzero(cMm func, cMm x, cMm tol); 
Mm DLLI fzero(cMm func, cMm x, cMm tol, cMm trace); 
Mm DLLI fzero(cMm func, cMm x, cMm tol, cMm trace, cMm varargin); 
Mm DLLI quad(cMm func); 
Mm DLLI quad(cMm func, cMm a); 
Mm DLLI quad(cMm func, cMm a, cMm b); 
Mm DLLI quad(cMm func, cMm a, cMm b, cMm tol); 
Mm DLLI quad(cMm func, cMm a, cMm b, cMm tol, cMm trace); 
Mm DLLI quad(cMm func, cMm a, cMm b, cMm tol, cMm trace, cMm varargin); 
Mm DLLI conls(cMm C); 
Mm DLLI conls(cMm C, cMm d); 
Mm DLLI conls(cMm C, cMm d, cMm A); 
Mm DLLI conls(cMm C, cMm d, cMm A, cMm b); 
Mm DLLI conls(cMm C, cMm d, cMm A, cMm b, cMm vlb); 
Mm DLLI conls(cMm C, cMm d, cMm A, cMm b, cMm vlb, cMm vub); 
Mm DLLI conls(cMm C, cMm d, cMm A, cMm b, cMm vlb, cMm vub, cMm x0); 
Mm DLLI conls(cMm C, cMm d, cMm A, cMm b, cMm vlb, cMm vub, cMm x0, cMm neq) 

Mm DLLI lp(cMm c); 
Mm DLLI lp(cMm c, cMm A); 
Mm DLLI lp(cMm c, cMm A, cMm b); 
Mm DLLI lp(cMm c, cMm A, cMm b, cMm vlb); 
Mm DLLI lp(cMm c, cMm A, cMm b, cMm vlb, cMm vub); 
Mm DLLI lp(cMm c, cMm A, cMm b, cMm vlb, cMm vub, cMm x0); 
Mm DLLI lp(cMm c, cMm A, cMm b, cMm vlb, cMm vub, cMm x0, cMm neq); 
Mm DLLI lp(cMm c, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI lp(cMm c, cMm A, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI lp(cMm c, cMm A, cMm b, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI lp(cMm c, cMm A, cMm b, cMm vlb, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI lp(cMm c, cMm A, cMm b, cMm vlb, cMm vub, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI lp(cMm c, cMm A, cMm b, cMm vlb, cMm vub, cMm x0, i_o_t, Mm& x, Mm& 
lam); 
Mm DLLI lp(cMm c, cMm A, cMm b, cMm vlb, cMm vub, cMm x0, cMm neq, i_o_t, Mm 
[$ x, Mm& lam)] 
Mm DLLI nnls(cMm A); 
Mm DLLI nnls(cMm A, cMm b); 
Mm DLLI nnls(cMm A, cMm b, i_o_t, Mm[$ x, Mm& w)] 
Mm DLLI nnls(cMm A, cMm b, i_o_t, Mm[$ x, Mm& w, Mm& err)] 
Mm DLLI qp(cMm Q); 
Mm DLLI qp(cMm Q, cMm c); 
Mm DLLI qp(cMm Q, cMm c, cMm A); 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b); 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, cMm vlb); 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, cMm vlb, cMm vub); 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, cMm vlb, cMm vub, cMm x0); 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, cMm vlb, cMm vub, cMm x0, cMm neq); 
Mm DLLI qp(cMm Q, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI qp(cMm Q, cMm c, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI qp(cMm Q, cMm c, cMm A, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, cMm vlb, i_o_t, Mm[$ x, Mm& lam)] 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, cMm vlb, cMm vub, i_o_t, Mm& x, Mm& l 
am); 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, cMm vlb, cMm vub, cMm x0, i_o_t, Mm& 
x, Mm[$ lam)] 
Mm DLLI qp(cMm Q, cMm c, cMm A, cMm b, cMm vlb, cMm vub, cMm x0, cMm neq, i_ 
o_t, Mm[$ x, Mm& lam)] 
Mm DLLI minimax(cMm func); 
Mm DLLI minimax(cMm func, cMm x0); 
Mm DLLI minimax(cMm func, cMm x0, cMm options); 
Mm DLLI minimax(cMm func, cMm x0, cMm options, cMm vlb); 
Mm DLLI minimax(cMm func, cMm x0, cMm options, cMm vlb, cMm vub); 
Mm DLLI minimax(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, cMm grad); 
Mm DLLI minimax(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, cMm grad, c 
Mm varargin); 
Mm DLLI minimax(cMm func, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI minimax(cMm func, cMm x0, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI minimax(cMm func, cMm x0, cMm options, i_o_t, Mm[$ x, Mm& options_o)] 

Mm DLLI minimax(cMm func, cMm x0, cMm options, cMm vlb, i_o_t, Mm& x, Mm& op 
tions_o); 
Mm DLLI minimax(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, i_o_t, Mm& 
x, Mm[$ options_o)] 
Mm DLLI minimax(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, cMm grad, i 
_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI minimax(cMm func, cMm x0, cMm options, cMm vlb, cMm vub, cMm grad, c 
Mm varargin, i_o_t, Mm[$ x, Mm& options_o)] 
Mm DLLI odeget(cMm options); 
Mm DLLI odeget(cMm options, cMm n); 
Mm DLLI odeget(cMm options, cMm n, cMm def); 
Mm DLLI odeset(); 
Mm DLLI odeset(cMm n1); 
Mm DLLI odeset(cMm n1, cMm v1); 
Mm DLLI odeset(cMm opts, cMm n1, cMm v1); 
Mm DLLI odeset(cMm n1, cMm v1, cMm n2, cMm v2); 
Mm DLLI odeset(cMm opts, cMm n1, cMm v1, cMm n2, cMm v2); 
Mm DLLI odeset(cMm n1, cMm v1, cMm n2, cMm v2, cMm n3, cMm v3); 
Mm DLLI odeset(cMm opts, cMm n1, cMm v1, cMm n2, cMm v2, cMm n3, cMm v3); 
Mm DLLI odeset(cMm n1, cMm v1, cMm n2, cMm v2, cMm n3, cMm v3, cMm n4, cMm v 
4); 
Mm DLLI odeset(cMm opts, cMm n1, cMm v1, cMm n2, cMm v2, cMm n3, cMm v3, cMm 
n4, cMm v4); 
Mm DLLI odeset(cMm n1, cMm v1, cMm n2, cMm v2, cMm n3, cMm v3, cMm n4, cMm v 
4, cMm n5, cMm v5); 
Mm DLLI odeset(cMm opts, cMm n1, cMm v1, cMm n2, cMm v2, cMm n3, cMm v3, cMm 
n4, cMm v4, cMm n5, cMm v5); 
Mm DLLI ode23(cMm func); 
Mm DLLI ode23(cMm func, cMm tspan); 
Mm DLLI ode23(cMm func, cMm tspan, cMm y0); 
Mm DLLI ode23(cMm func, cMm tspan, cMm y0, cMm options); 
Mm DLLI ode23(cMm func, cMm tspan, cMm y0, cMm options, cMm varargin); 
Mm DLLI ode23(cMm func, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode23(cMm func, cMm tspan, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode23(cMm func, cMm tspan, cMm y0, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode23(cMm func, cMm tspan, cMm y0, cMm options, i_o_t, Mm& tout, Mm& 
yout); 
Mm DLLI ode23(cMm func, cMm tspan, cMm y0, cMm options, cMm varargin, i_o_t, 
Mm[$ tout, Mm& yout)] 
Mm DLLI ode45(cMm func); 
Mm DLLI ode45(cMm func, cMm tspan); 
Mm DLLI ode45(cMm func, cMm tspan, cMm y0); 
Mm DLLI ode45(cMm func, cMm tspan, cMm y0, cMm options); 
Mm DLLI ode45(cMm func, cMm tspan, cMm y0, cMm options, cMm varargin); 
Mm DLLI ode45(cMm func, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode45(cMm func, cMm tspan, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode45(cMm func, cMm tspan, cMm y0, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode45(cMm func, cMm tspan, cMm y0, cMm options, i_o_t, Mm& tout, Mm& 
yout); 
Mm DLLI ode45(cMm func, cMm tspan, cMm y0, cMm options, cMm varargin, i_o_t, 
Mm[$ tout, Mm& yout)] 
Mm DLLI ode78(cMm func); 
Mm DLLI ode78(cMm func, cMm tspan); 
Mm DLLI ode78(cMm func, cMm tspan, cMm y0); 
Mm DLLI ode78(cMm func, cMm tspan, cMm y0, cMm options); 
Mm DLLI ode78(cMm func, cMm tspan, cMm y0, cMm options, cMm varargin); 
Mm DLLI ode78(cMm func, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode78(cMm func, cMm tspan, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode78(cMm func, cMm tspan, cMm y0, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode78(cMm func, cMm tspan, cMm y0, cMm options, i_o_t, Mm& tout, Mm& 
yout); 
Mm DLLI ode78(cMm func, cMm tspan, cMm y0, cMm options, cMm varargin, i_o_t, 
Mm[$ tout, Mm& yout)] 
Mm DLLI ode15s(cMm func); 
Mm DLLI ode15s(cMm func, cMm tspan); 
Mm DLLI ode15s(cMm func, cMm tspan, cMm y0); 
Mm DLLI ode15s(cMm func, cMm tspan, cMm y0, cMm options); 
Mm DLLI ode15s(cMm func, cMm tspan, cMm y0, cMm options, cMm varargin); 
Mm DLLI ode15s(cMm func, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode15s(cMm func, cMm tspan, i_o_t, Mm[$ tout, Mm& yout)] 
Mm DLLI ode15s(cMm func, cMm tspan, cMm y0, i_o_t,   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结 Copy to clipboard 
Posted by: webycn 
Posted on: 2002-10-18 14:38 

MATCOM已经被MATHTOOLS收购了,没有新版的matcom了。:!( 
从matlab65的在线帮助中,搜集了一些东西,希望对大家有用。   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结 Copy to clipboard 
Posted by: wcs6208 
Posted on: 2002-10-18 15:44 

还是小和尚功力高!!   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结 Copy to clipboard 
Posted by: future 
Posted on: 2002-10-18 17:02 

请问能不能上传最新的matcom,还有我想问一个想生成stand-alone的程序时,要不要先安装C/C++。   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结 Copy to clipboard 
Posted by: 小和尚 
Posted on: 2002-10-18 19:10 

其实新版的matlab6.5自带的compile,不用matcom了,也不用装c,可以做成独立的exe文件.   

-------------------------------------------------------------------------------- 
回复: (转贴)Matlab与C++接口与混合编程讨论小结 Copy to clipboard 
Posted by: greenbow 
Posted on: 2002-10-19 13:53 

matlab6.0(R12) stand-alone方式 

Solution Number: 27257 
Date Last Modified: 2002-05-24 
Product: MATLAB C/C++ Math Library 2.1 ==> Current Version 
Platform: Windows 

Problem Description 

How do I create a stand-alone C or C++ executable in the Microsoft Visual C/C++ 6.0 IDE from the project files in $MATLAB/extern/examples/cmath or $MATLAB/extern/examples/cppmath using MATLAB 6.0 (R12)? 

Are the project files in $MATLAB/extern/examples/cmath or cppmath updated for use with the C++ Math Library 2.1? 

Solution: 

The project files in the $MATLAB/extern/examples/cmath and cppmath directories were not changed for versions 1.2, 2.0, or 2.1 of the MATLAB C/C++ Math Library. The project files are the same files that were available in version 1.1 of the MATLAB C/C++ Math Library. 

In general it is not practical for us to offer complete technical support on the details of using any specific one of the large number of IDE environments our customers use. If you need detailed assistance with the particular settings needed to get your IDE environment to generate code that successfully compiles and runs with our products, please contact the manufacturer of your IDE to get information or expert technical assistance in using it. 

NOTE: The following solution is to be used ONLY with the MATLAB C/C++ Math Library 2.1, released with MATLAB 6.0 (R12). If you have a version of the C/C++ Math Libraries previous to 2.1 please use solution 21291. You can find solution 21291 at the following location: 

http://www.mathworks.com/support/solutions/data/21291.shtml 

If you do not have MATLAB 6.0, please use the following steps to create a stand-alone C or C++ executable with the Microsoft Visual C/C++ 6.0 IDE and C/C++ Math Libraries 2.1: 

1. Start up the Microsoft Visual C/C++ 6.0 IDE 

2. Go to FILE and NEW. Click on Projects Tab. Select Win32 Console Application. In the Project Name field type: ex1. Create new workspace should be filled in. In the Platforms field, Win32 should also be checked. Click OK. 

3. Highlight ex1 files and then right click. Select Settings. Click on the C/C++ Tab. In the Category listbox select Code Generation. In the Use Runtime library listbox select Multithreaded DLL. Change the Category listbox to Preprocessor. Add to the Preprocessor definitions _WINDOWS, _AFXDLL,IBMPC, MSVC, MSWIND, __STDC__ so: 

WIN32,_DEBUG,_CONSOLE,_MBCS 

changes to: 

WIN32,_DEBUG,_CONSOLE,_MBCS,_WINDOWS,_AFXDLL,IBMPC,MSVC,MSWIND,__STDC__ 

Add to the Additional include directories field: 

$MATLAB\extern\include (where $MATLAB is your root directory) 

NOTE: If you are using the C++ Math Library then also add 

$MATLAB\extern\include\cpp 

Click on the Link Tab. In the Category listbox select Input. For C applications, the Object/Library modules field would change from: 

kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 

to: 

libmmfile.lib libmatlb.lib libmx.lib libmat.lib sgl.lib libmwsglm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 

Add the libraries path under Additional library path: 

$MATLAB\extern\lib\win32\microsoft\msvc60 

NOTE: If you are creating C++ executables you will need to add libmatpm.lib also to the Object/Library modules field. Also add the following library path under Additional library path: 

$MATLAB\extern\lib\win32 

Click OK. 

4. Go to Build and Rebuild All. 

5. Go to Build and Execute ex1.exe. 
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值