Generate DLL from matlab R14SP3 and call by python 3.5

10 visualizaciones (últimos 30 días)
michael
michael el 12 de En. de 2020
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?

Respuestas (0)

Categorías

Más información sobre Call Python from MATLAB en Help Center y File Exchange.

Productos


Versión

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by