I have generated a DLL from matalb model which sums two numbers and gives output. (a+b=c). How can I use that DLL in .NET C#
Show older comments
I have generated a DLL from matalb model which sums two numbers and gives output. (a+b=c). How can I use that DLL in .NET C#. I have used dumpbin.exe to find the generated C function. But none of them is of relevance to the operartion we are doing that is adding two numbers. How to use the DLL in .net?
Answers (1)
Are you sure that it is what you want to do? Note that at this point, your question has nothing to do with matlab anymore, and is simply about how to invoke dll from C#.
The answer to that is to use PInvoke, the details of which are off-topic for this forum. I guess the signature for your function would be:
[DllImport("yourdll.dll")]
public static extern double yourfun(double a, double b);
Note that you don't need to generate dlls to call matlab code from C#. You can simply use the COM automation server.
1 Comment
Asheema Wanchoo
on 13 Jan 2016
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!