use C# lib in MatLab
조회 수: 88 (최근 30일)
이전 댓글 표시
How can I use a C# Library with MatLab
댓글 수: 0
답변 (1개)
Kojiro Saito
2019년 9월 14일
You can call your C# library by loading dll using NET.AddAssembly and call its function.
In this example, NetDocCell.dll is used and it is compiled from NetDocCell.cs described in C# NetDocCell code in this document.
Here is a snippet to call C# dll.
dllPath = fullfile(pwd, 'NetDocCell.dll');
% Load C# dll
asm = NET.addAssembly(dllPath);
% Creat a C# class
graph = NetDocCell.MyGraph;
% Create cell array containing all data
mlData = cell(graph.getNewData);
% Plot the data and label the graph
figure('Name',char(mlData{1}))
plot(double(mlData{2}(2)))
xlabel(char(mlData{2}(1)))
댓글 수: 1
Jakup Tauser a Lava
2024년 3월 28일 10:23
편집: Jakup Tauser a Lava
2024년 3월 28일 10:24
Hey
I need to use some c# .dll inside simulink.
Woud the best strategy be to use matlab functions that handle the c# dll inside simulink?
:)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!