How can I compile with MATLAB a DLL that can be used in Python code?

7 ビュー (過去 30 日間)
Michele Manfredda
Michele Manfredda 2018 年 7 月 5 日
コメント済み: Michele Manfredda 2018 年 7 月 5 日
Hi, I'm trying what I said in the title: I have a huge portion of MATLAB code (that uses classes as well) that I would like to compile into a .DLL, then call the compiled function from Python.
I was succesfull in Creating a .DLL with VC++ and calling it from within Python. I followed the code Here
The lines I used in python are
import ctypes as ct
from ctypes import cdll
Path_Dll = "D:\\Test\\test_dll.dll"
mydll = cdll.LoadLibrary(Path_Dll)
mydll.sum(5, 3)
Then I attemped to compile a matlab function (Sum.m) using
mcc -B csharedlib:test_dll -T link:lib Sum.m
but the same code as before did not work (WinError 126: The specified module could not be found).
Any clues?
Thanks!
Cap
  1 件のコメント
Michele Manfredda
Michele Manfredda 2018 年 7 月 5 日
Here it is suggested that the direct link Python<--->DLL-Compiled-With-Matlab is not possible. But.... why????

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by