作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2008, Vol. 34 ›› Issue (14): 87-89. doi: 10.3969/j.issn.1000-3428.2008.14.031

• 软件技术与数据库 • 上一篇    下一篇

基于COM技术的C#与Matlab混合编程

姚光强,陈立平   

  1. (国家农业信息化工程技术研究中心,北京 100097)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2008-07-20 发布日期:2008-07-20

Integrated Programming Between C# and Matlab Based on Component Object Model

YAO Guang-qiang, CHEN Li-ping   

  1. (National Engineering Research Center for Information Technology in Agriculture, Beijing 100097)
  • Received:1900-01-01 Revised:1900-01-01 Online:2008-07-20 Published:2008-07-20

摘要: 提出基于组件对象模型(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)

中图分类号: