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"

조회 수: 132 (최근 30일)
I have .dll file which I want to open and run in MATLAB. What is the procedure, please suggest.

채택된 답변

Kojiro Saito
Kojiro Saito 2020년 3월 3일
편집: Kojiro Saito 2020년 3월 4일
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
Krutika  Shetkar
Krutika Shetkar 2020년 3월 18일
Hi Kojiro,
Is there any solution where I can run the dll file in simulink? Can you suggest me how to run the dll file in simulink to check the results.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Krutika  Shetkar
Krutika Shetkar 2020년 3월 12일
Hi Kojiro,
I have successfully loaded the dll library. Can you suggest me how to test the file like how I can run the file and check the output in simulink/MATLAB.

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by