# linking between C# and MATLAB



## mehdim20001 (Mar 18, 2011)

Hi all
I want to linking between matlab and C# in the middle of a Mfile, such that send some matrix from matlab to C#,some calculation doing in C#, and result (in the matrix form) resend to Mfile, and based on this matrix, the rest line in Mfile processed.
I don't know how can i do this!


----------



## Ninjaboi (Dec 27, 2010)

link Matlab and C# : Microsoft, Visual C#, 2008 Express Edition

That link may prove useful. I've never used MATLAB, so I'm at a loss for you.


----------



## niemiro (Feb 20, 2010)

The long and short of the above link:



> Matlab exposes an API (I think it is called their "Matlab Engine".) That is, you can host Matlab inside another Application during run time. If you are using only native utilities in Matlab, then you should be able to host the Matlab engine at run time, call the native utility (e.g., kMeans) and then process the results of that call in your C# Application. See this: 1..2..3 ways of integrating MATLAB with the .NET - CodeProject


----------

