I need to pass python dictionary into matlab and matlab returns the variable after performing some operation as follows:
Matlab function in file named useMatlab4Sum.m:
function matlabSum = useMatlab4Sum(var)
varin = struct(var)
a = varin.var
arr = varin.arr
return a*arr(:)
In Python:
myDict = {'a':2, 'arr':np.array([[1, 2],[3, 4]])}
eng = matlab.engine.start_matlab()
params = eng.useMatlab4Sum(myDict)
eng.quit
But I get the error:
TypeError: unsupported Python data type: numpy.ndarray
I have a more complicated case that I am working through, I am just using the above simple case for example.