using C# functions in matlab

Hi, I wanted to use functions from a c# dll in matlab. How would I do this using version 2010a
Thanks Barinder

回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2012 年 2 月 13 日
編集済み: Kaustubha Govind 2012 年 11 月 19 日

2 投票

Is it a .NET library? If yes, see Using .NET Libraries from MATLAB.

7 件のコメント

Friedrich
Friedrich 2012 年 2 月 13 日
Right, for .NET MATLAB has a different API. The command to start with is NET.addAssembly.
Barinder
Barinder 2012 年 2 月 13 日
I tried using NET.addAssembly('X.dll') and I get the following message back.
??? 'X.dll' could not be found in the .NET Global Assembly Cache (GAC)
I have no clue what this means.
Thanks Barinder
Kaustubha Govind
Kaustubha Govind 2012 年 2 月 14 日
See http://msdn.microsoft.com/en-us/library/dkkx7f79(vs.71).aspx
Barinder
Barinder 2012 年 2 月 14 日
After using the utility gacutil /i X.dll I now get a different message from matlab.
"Could not load file or assembly 'EZ_B, Version=2012.2.8.0, Culture=neutral,
PublicKeyToken=839146fd54f35ea1' or one of its dependencies. The system cannot find the file specified.
Source: mscorlib
HelpLink:"
Any ideas?
Thanks
Barinder
Kaustubha Govind
Kaustubha Govind 2012 年 2 月 14 日
Sorry, I don't have any experience with .NET assemblies, but you might be able to find something by searching on the web. Does your DLL load a third-party assembly called EZ_B? Looks like that DLL (or one of its depedencies) could not be loaded. You probably need to register all those DLLs also with GAC, or add it to the system path: http://stackoverflow.com/questions/951259/could-not-load-file-or-assembly-or-one-of-its-dependencies-access-is-denied
John
John 2012 年 11 月 15 日
The suggestion to see "Using .NET Libraries from MATLAB" looked primising, but the link is broken.
Kaustubha Govind
Kaustubha Govind 2012 年 11 月 19 日
Thanks for pointing that out, John! Fixed the link.

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

Walter Roberson
Walter Roberson 2012 年 2 月 10 日

0 投票

See loadlibrary() . You will need a .h file for the dll .

カテゴリ

タグ

質問済み:

2012 年 2 月 10 日

編集済み:

2013 年 10 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by