MATLAB Answers

How to call .dll functions?

272 ビュー (過去 30 日間)
Saleha Fatema
Saleha Fatema 2019 年 1 月 4 日
編集済み: Philip Borghesani 2019 年 1 月 4 日
HI,
I am running a code which calls a function of .dll extension file tye. I also have the same function in C. Can anyone please tell me how to do that?
I am attaching the code and necessary function files.

  0 件のコメント

Sign in to comment.

回答 (2 件)

Image Analyst
Image Analyst 2019 年 1 月 4 日
Use the MATLAB function loadlibrary().

  3 件のコメント

Saleha Fatema
Saleha Fatema 2019 年 1 月 4 日
The problem with loading the c file is that I do not have the required header file. That's why I couldn't use the function loadlibrary().
Image Analyst
Image Analyst 2019 年 1 月 4 日
You need the h file and the dll file. If you don't have the h file, ask the developer/manufacturer of the DLL.
Saleha Fatema
Saleha Fatema 2019 年 1 月 4 日
The developer mentioned the file as "binary MEX files". To call a MEX file, header is not required, right? According to mathworks just the name of the file, without the file extension is enough.

Sign in to comment.


Philip Borghesani
Philip Borghesani 2019 年 1 月 4 日
編集済み: Philip Borghesani 2019 年 1 月 4 日
Mex files are normaly called just like other Matlab functions there is no need for loadlibrary. On Windows all mex files are actually dlls but MATLAB has used the extensions mexw32 and mexw64 for many years. 32 bit versions of MATLAB may still recognize .dll files as mex files but no 64 bit copy (R2016a or later) of MATLAB can use one. It is possible that you can simply rebuild this file using the mex command, but this mex file appears to be written in 2001 and last modified in 2006 so I doubt it has been built and tested on 64 bit Windows or with a recent MATLAB, there may be other issues.

  0 件のコメント

Sign in to comment.

タグ


Translated by