How to open .dll file in MATLAB. I have converted the .slx file to .dll file format. Now I want to open and see the results. I don't have any header file which I can use with the function "loadlibrary"
120 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Krutika Shetkar
el 2 de Mzo. de 2020
Comentada: Kojiro Saito
el 18 de Mzo. de 2020
I have .dll file which I want to open and run in MATLAB. What is the procedure, please suggest.
0 comentarios
Respuesta aceptada
Kojiro Saito
el 3 de Mzo. de 2020
Editada: Kojiro Saito
el 4 de Mzo. de 2020
For C shared library, you can load the dll by loadlibrary and call functions by calllib.
For detail, please see this document.
For C++ shared library, you need to do addpath in order to set your dll file to MATLAB's search path and you can call functions by clib.libname.funcname.
For detail, please see this document.
For .NET assembly, you can load the dll by NET.addAssembly and call functions by like this.
asm = NET.addAssembly('your.dll');
cls = dotNetTestClass.TestClass; % dotNetTestClass is namespace and TestClass is class in C#
a = 1; % Input 1
b = 2; % Input 2
result = TestFunc(cls, a, b); % TestFunc is function name in C#
For detail, please see this document.
If the dll is created from .slx using Embedded Coder, you need to do an additional step as described in the following answer.
12 comentarios
Kojiro Saito
el 18 de Mzo. de 2020
There are various ways to do that and here is a link to File Exchange page which describes them.
Más respuestas (1)
Ver también
Categorías
Más información sobre C Shared Library Integration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!