python package using matlab object handle
Mostrar comentarios más antiguos
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 comentarios
wallflower
el 30 de Dic. de 2020
Have you found the solution to your problem? I am dealing with it too...
Pri_Comet
el 27 de Mayo de 2021
Facing the same issue here. Would love to know if you've found a solution.
Respuestas (0)
Categorías
Más información sobre Call Python from MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!