python package using matlab object handle

Dear All,
I would like to compile my matlab function to python package library. Thus, I make a function parser , i.e. loadObject, printObject, etc. from my matlab object handle.
However, is it possible to pass matlab object handle using matlab struct for python? I remember, I did that for my implementation in C using mwArray. Is there any similar library?
I can't using matlab engine since it requires matlab license
Thank you,
Ryvo Octaviano
function var = loadObject()
var.obj = matlabClass();
end
function printObject(var)
printObject(var.obj);
end
classdef matlabClass < handle
properties
a = 1;
end
methods
function obj = matlabClass()
end
function printObject(obj)
disp(obj.a)
end
end
end
function TestScript()
var = loadObject();
printObject(var);
end
I got this error:
Traceback (most recent call last):
File "loadObjectSample.py", line 15, in <module>
varOut = my_TESTJava.loadObject()
File "C:\Program Files\MATLAB\MATLAB Runtime\v96\toolbox\compiler_sdk\pysdk_py\matlab_pysdk\runtime\deployablefunc.py", line 80, in __call__
nlhsWasSpecified, stdoutObj, stderrObj).result()
File "C:\Program Files\MATLAB\MATLAB Runtime\v96\toolbox\compiler_sdk\pysdk_py\matlab_pysdk\runtime\futureresult.py", line 135, in result
raise e
File "C:\Program Files\MATLAB\MATLAB Runtime\v96\toolbox\compiler_sdk\pysdk_py\matlab_pysdk\runtime\futureresult.py", line 123, in result
raise e
File "C:\Program Files\MATLAB\MATLAB Runtime\v96\toolbox\compiler_sdk\pysdk_py\matlab_pysdk\runtime\futureresult.py", line 113, in result
self._nlhs, out=self._out, err=self._err)
matlab_pysdk.runtime.MatlabRuntimeError: An error occurred when evaluating the result from a function. Details: invalid map<K, T> key

2 个评论

Have you found the solution to your problem? I am dealing with it too...
Facing the same issue here. Would love to know if you've found a solution.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Call Python from MATLAB 的更多信息

产品

版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by