Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interoperating between Matlab and C#

After peeking around the internet it looks like it is possible to interop between C# and Matlab. I am wondering if anyone has had success with it and what they did to do so. If possible somehow pulling it off without the use of COM. Thanks for your time.

like image 723
smaclell Avatar asked Jan 12 '09 03:01

smaclell


People also ask

What is the difference between MATLAB and C?

The difference between Matlab and C language is that Matlab is an interactive computing environment while C language is a high level general purpose programming language.

Is MATLAB better than C?

In our experience in engineering computing we find that MATLAB is much better suited than C for this task but the best choice in terms of clarity and functionality of the language is provided by Python.

Which is faster MATLAB or C?

Performance is comparable for small to medium size systems while the C implementation is up to 2.5 times faster than MATLAB for large systems, which makes sense!

Is MATLAB coded in C?

You can use MATLAB algorithms in your C and C++ applications. The MATLAB Engine API for C and C++ enables your applications to use and modify variables in the MATLAB workspace, call MATLAB functions, and evaluate MATLAB commands.


1 Answers

Beginning with the R2009a release of MATLAB, .NET objects can be accessed from MATLAB:

http://www.mathworks.com/help/techdoc/matlab_external/brpb5k6.html

In older versions of MATLAB, it is possible to access .NET objects from MATLAB using CCW:

http://www.mathworks.com/support/solutions/data/1-5U8HND.html?solution=1-5U8HND

and the MATLAB engine from .NET:

http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_external/f135590.html#f135616

You can also use the MATLAB Builder NE to wrap m-code into .NET assemblies.

http://www.mathworks.com/products/netbuilder/

like image 126
Todd Avatar answered Sep 16 '22 13:09

Todd