Matlab与Fortran混合编程之DLL实现方法
详细信息 本馆镜像全文    |  推荐本文 | | 获取馆网全文
摘要
简要介绍Matlab和Fortran各自的优缺点,详细阐述Matlab调用Fortran生成的动态链接库实现混合编程的两种方法。以高斯约当列主元素法求逆为例,从计算时间、精度等方面详细比较了同一算法在多种实现方式下的执行情况。计算结果表明:基于动态链接库的混合编程方法能充分利用现有软件包,结合Fortran计算效率高、Matlab矩阵计算及图形处理功能强的优点,符合当前科学工程计算程序设计的发展方向。
The advantages and disadvantages of Matlab and Fortran is briefly introduced in this article.And two methods of mixed language programming through calling Fortran dynamic link library from Matlab are discussed in detail.Take Gauss-Jordan elimination with partial pivoting for example,the computational results of the same algorithm under a variety of different implementation ways are carefully compared in terms of accuracy and computational time.The result indicatesthat,mixed language programming via dynamic link library can make full of existing packages,combine high efficiency of Fortran with powerful matrix computation and figure drawing and compiling functions of Matlab,thus conforming to the current development direction of programming in scientific and engineering computing.
引文
[1]Matlab COM builder user's guide[Z].The Mathworks Inc,2002.
    [2]岳玉芳,尤忠生,张玉双.基于COM的VB与Matlab混合编程[J].计算机工程与设计,2005,26(1):61-62.
    [3]姚光强,陈立平.基于COM技术的C#与Matlab混合编程[J].计算机工程,2008,34(4):87-89.
    [4]肖永韧,解习农,刘晓峰.VC与MATLAB混合编程之DLL实现方法[J].计算机工程与应用,2001,37(13):174-176.
    [5]陶红,袁金荣.MATLAB与C/Visual C++混合编程的实现[J].计算机工程与应用,2000,36(10):100-101.
    [6]谭炎,张凌燕.MATLAB与VB混合编程技术研究[J].微计算机信息,2006,22(15):247-249.
    [7]聂万胜,庄逢辰,黄玲,等.FORTRAN程序调用MATLAB引擎实现计算可视化[J].计算机应用,2000,20(11):60-62.
    [8]徐天吉,程冰洁.Compaq Visual Fortran与Matlab混合编程实现小波域地震信号多尺度分析[J].物探化探计算技术,2008,30(3):185-190.
    [9]刘志俭.MATLAB应用程序接口用户指南[M].北京:科学出版社,2000.
    [10]Einarsson B,Morven Gentleman W.Mixed language programming[J].Software-Practice and Experience,1984,14:383-395.
    [11]Einarsson B.Application of mixed language programming[J].Computer Physics Communications,1990,61:150-162.
    [12]Decyk V K.A method for passing data between C and Opaque Fortran 90 pointers[J].Fortran Forum,2008,27(2):2-7.

版权所有:© 2023 中国地质图书馆 中国地质调查局地学文献中心