调用从C#一个函数MATLAB [英] Calling a MATLAB function from C#

查看:172
本文介绍了调用从C#一个函数MATLAB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我公司开发的MATLAB功能,我正在寻找一种方式来从另一个调用C#应用程序的功能,并通过一些参数,并得到了C#程序的结果。

I developed a MATLAB function, and I'm looking for a way to call that function from another C# application and pass some parameters to it and get the results in the C# program.

我听说,我可以使用动态数据交换(DDE)或COM对象,但我能做到吗?

I heard that I can use Dynamic Data Exchange (DDE) or COM objects, but have can I do it?

推荐答案

有在很好的例子MATLAB中心

这显示了如何使用 MATLAB 沟通方式有三种:

It shows three ways on how to communicate with MATLAB:


  1. COM

  2. MATLAB .NET Bulider

  3. MATLAB编译器

COM (我没有任何与它的经验)

COM (I do not have any experience with it)

缺点:需要MATLAB要在目标计算机上安装

Cons: MATLAB is required to be installed on the target computer.

MATLAB .NET建设者编译您的MATLAB code到.NET程序集,您可以直接使用它。

MATLAB .NET builder compiles your MATLAB code to the .NET assembly and you can use it directly.

优点:不需要MATLAB要在目标计算机上安装

Pros: MATLAB is not required to be installed on the target computer

缺点:它是昂贵的。

MATLAB编译器编译您的MATLAB code到C / C ++库或EXE文件。您可以使用它通过的P / Invoke

MATLAB compiler compiles your MATLAB code into a C/C++ library or EXE file. You can use it through P/Invoke.

优点:不需要MATLAB要在目标计算机上安装

Pros: MATLAB is not required to be installed on the target computer

缺点:它是昂贵的,大量的P / Invoke的

Cons: It's expensive, a lot of P/Invoke.

这篇关于调用从C#一个函数MATLAB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆