登录
首页 » Matlab » c++调MATLAB程序代码

c++调MATLAB程序代码

于 2022-03-01 发布 文件大小:6.75 kB
0 85
下载积分: 2 下载次数: 1

代码说明:

Matlab是美国MathWorks公司的产品,是一种以矩阵为基本编程单位的高效数值计算语言。Matlab集科学计算、图像处理、声音处理于一体,为用户提供了丰富Windows图形界面设计方法,使用户能够在利用其强大数值计算功能的同时设计出友好的图形界面。Matlab已经被证明是在应用数学、物理、工程学和其它涉及复杂数值计算等应用领域中解决问题的优秀工具。Matlab能够在Win95/98、Win2000、Linux和Unix等多种操作系统平台上运行。C、C++是众多程序员十分喜爱的高级程序设计语言,但其在数值处理分析和算法 工具等方面,效率远远低于Matlab 语言;在准确方便地绘制数据图形方面,Matlab 语 言具有C和C++无法比拟的优势。但Matlab作为一种以解释方式运行的计算机语言,其程序的执行效率较低,而且不能实现端口操作和实时控制。因此,若能将两者结合运用,实现优势互补,将获得极大的效益。为此,MathWorks公司提供了Matlab和C、C++的接口。通过接口,用户既可在C程序中调用Matlab的函数,也可在Matlab中调用C或C++程序,从而实现Matlab和C、C++的混合编程。本文主要讨论如何在C、C++中调用Matlab。一、过程分析在C、C++中调用Matlab的主要过程如下所示:1) 首先调用engOpen函数打开一个Matlab工程。2) 生成mxArray。在Matlab中,所有变量类型,如标量、向量、矩阵、字符串、细胞矩阵和结构,都以mxArrays形式来保存,固数据操作都必须通过这些mxArrays来完成。生成mxArray有两种不同的方式。一是用mxCreate函数来创建矩阵,之后用mxSetName函数对它进行命名.另一种方式是选择将一个自定义的数据结构复制到mxArray中,值得注意的是Matlab在存 储矩阵时是按列序保存的,而在C、C++中是按行序保存的,所以转换时注意分清下标。3) 调用engPutArray函数将矩阵放入到Matlab工作区中。4) 通过engEvalString函数向Matlab传递命令,如果成功,函数返回值为此0,否则返回一个非0值

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • svdtest
    用于描述26个英文字母在奇异值分解后的空间平面的分布(the English texts are mapped into frequency matrixes of order 26 and the dimensions of texts representation space are reduced through Singular Value Decomposition. Second, it fuses the features of the )
    2010-03-07 13:10:13下载
    积分:1
  • Wee
    小波熵在燃烧扰动相关信号提取中的应用PDF,需要的可以下载随便看看(xiao bo shang Wse)
    2012-04-18 19:21:21下载
    积分:1
  • momentum
    UDF添加动量源项 fluent仿真分析虚拟螺旋桨(UDF momentum)
    2020-11-18 10:09:39下载
    积分:1
  • SAMP
    在压缩感知中求解稀疏度未知的改进匹配追踪算法(In the compression degree of unknown sparse perception algorithm)
    2020-11-17 23:29:40下载
    积分:1
  • the simulation provides computation of target reflectivity data in the deficient...
    the simulation provides computation of target reflectivity data in the deficient elevation domain. Simulations are implemented to test the decoupled least-squares technique for high resolutionspectral estimation of target reflectivity.all seven (7)files should be downloaded for the simulation to work.(dls3D.m,estimate.m,get2S1Data.m,getConstraints.m, getImageData.m,getPixelData.m, getSLICYData.m)
    2022-05-08 03:07:41下载
    积分:1
  • ldpc_gen_coding_decoding
    LDPC的检验矩阵的生成,编码和译码过程。(The process of LDPC codes generating,encoding and decoding.)
    2020-07-08 11:08:56下载
    积分:1
  • sdarticle(2).pdf
    SDELab article describing the usage and application of the package to solve stochastic equations
    2009-12-22 22:44:31下载
    积分:1
  • 6
    说明:  Linearity in the mathematical sense is more than a straight line graph. In the jargon, it means additive and homogeneous.
    2012-06-29 17:58:08下载
    积分:1
  • delaysim
    SMULINK model for simulation of communication delay
    2013-09-27 02:21:48下载
    积分:1
  • US20130015666
    Wind energy is one of the fastest growing energy and it will continue to grow around the world
    2015-03-13 19:23:16下载
    积分:1
  • 696518资源总数
  • 105958会员总数
  • 18今日下载