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

wallflower
wallflower 2020년 12월 30일
Have you found the solution to your problem? I am dealing with it too...
Pri_Comet
Pri_Comet 2021년 5월 27일
Facing the same issue here. Would love to know if you've found a solution.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2020년 3월 15일

댓글:

2021년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by