Calling a MEX file from C# application...

Is it possible to call a matlab generated/compiled file (like MEX) from a C# Windows application? I would like to develop a generic data collection application which can process and display user defined signal processing algorithms. My thought was to have the user supply a generic MEX file for the dataa processing only (Assuming the I/O of the DLL will be user known for passing data to and from the MEX function.) The functions will be simple and provide only a simple output(Examples: Min, Max, Mean, etc). Also, can this be possible without having Matlab installed on the machine (ie. all the code need is complied into the MEX DLL?

回答 (1 件)

Kaustubha Govind
Kaustubha Govind 2011 年 8 月 2 日

1 投票

MEX-functions call into MATLAB run-time libraries, so you do need to have MATLAB, or if you are using MATLAB Compiler-based products, the MATLAB Compiler Runtime, installed on the machine. In the latter case, you can have a wrapper MATLAB (.m) function call into the MEX-function, and use MATLAB Builder NE to create a .NET assembly from it. You can also use the more basic MATLAB Compiler product to build a shared library from it.
See Working with the MCR for more information about the MATLAB Compiler Runtime.

2 件のコメント

Sriram
Sriram 2012 年 11 月 16 日
hi,
I have a mex file created from matlab.... i need to use it in c# ... but i couldn't add refrence to my existing c# project as it supports oly .dll and not .mex... is there any other way to add into c#???
Kaustubha Govind
Kaustubha Govind 2012 年 11 月 19 日
Sriram: Please read my answer - I think it applies to your question as well.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler についてさらに検索

タグ

質問済み:

2011 年 8 月 2 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by