摘要: 提出基于组件对象模型(COM)技术实现Visual C#与Matlab混合编程的2种方法,一种是通过C#使用Matlab提供的自动化服务,另一种是使用Matlab COM Builder将M语言文件编译成COM组件供C#调用。以地理信息系统中常用的空间插值分析为例给出了这2种方法的具体实现。对两者进行比较,提出了各自的适用范围。结果表明使用COM技术实现混合编程能充分发挥Visual C#与Matlab各自的特点,提高程序开发和运行效率。
关键词:
Visual C#语言,
Matlab软件,
混合编程,
组件对象模型
Abstract: Two approaches of integrated programming based on Component Object Model(COM) are introduced. One utilizes the automation server provided by Matlab. The other compiles the Matlab program written in M scripting language to component by using Matlab COM builder, then invoking it in Visual C#. The usual spatial interpolation algorithm in GIS is implemented by these two approaches. The advantages and defects of them are discussed, and the adaptive application range is suggested. The result is that the COM based methods for integration, which make full use of the two platforms, can speed up software development and improve its performance.
Key words:
Visual C#,
Matlab,
integrated programming,
Component Object Model(COM)
中图分类号:
姚光强;陈立平. 基于COM技术的C#与Matlab混合编程[J]. 计算机工程, 2008, 34(14): 87-89.
YAO Guang-qiang; CHEN Li-ping. Integrated Programming Between C# and Matlab Based on Component Object Model[J]. Computer Engineering, 2008, 34(14): 87-89.