Generate DLL from matlab R14SP3 and call by python 3.5

1 次查看(过去 30 天)
I have some matlab code (split over 4 files test.m, a.m, b.m, c.m) from which I'd like to generate DLL file to be called by external application. The main function test(x, y, z) in test.m contains three inputs of type string without any output argument - it writes some data into a file and standard output.
I'm generating the from matlab DLL with:
mcc -B csharedlib:testLib test.m a.m b.m c.m
I'm receiving some files and DLL.
Now I'm calling this DLL by following python code:
from ctypes import *
mydll = cdll.LoadLibrary("testLib.dll")
mydll.test("string1", "string2", "string3")
On the 2nd line I'm getting following error: "OSError: [WinError 193] %1 is not a valid Win32 application"
My environment is Win7, 64 bit
Any idea where there is a problem?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

产品


版本

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by